【发布时间】:2023-03-21 14:31:01
【问题描述】:
错误是当我将值 an int 与设置字符串长度的 char 的 strnlen 进行比较时。我正在做的是在字符串中搜索某个 # 并跟踪它是否找到。
for (value = 0; value < strlen(stringValue) && !searchFound; value++)
{
if (stringValue[value] == searchDigit)
{
numberTimesSearchFound = numberTimesSearchFound + 1;
//ends loops once it is found
searchFound = true;
} //end of string value if else loop}
【问题讨论】: