【发布时间】:2015-04-01 11:22:44
【问题描述】:
我在理解如何对 char 进行二进制搜索时遇到问题。我必须搜索智能手机的名称。我有这个:
typedef struct smartphone {
char name[50];
double weight;
} smartphone;
smartphone smartphone[50];
char smartphone_searched = "Xperia U";
所以,我必须对名称“Xperia U”进行二分搜索。有什么建议?
【问题讨论】:
-
不能在 char 变量中保存字符串。