我被困在一些没有评分的作业上(这意味着练习).
我必须创建一个带有find_name2个参数的函数.第一个参数是名称(字符串)的二维数组,第二个参数是用于在二维数组中查找名称的字符串,如果找到其他0,则函数必须返回1.
当我调用该函数(现在为空)时,我得到了这个 warning: passing argument 1 of 'find_name' from incompatible pointer type
这是重要的一点.
在主要
char strNameList[][2] = { { "Luca","Daniel"} ,{"Vivan","Desmond"},{"Abdul","Justin"}, {"Nina","Marlene"},{"Donny","Kathlene"} };
char strFindName[] = "\0";
printf("Please enter a name to look for: ");
gets(strFindName);
nSearch = find_name(strNameList, strFindName);
Run Code Online (Sandbox Code Playgroud)
功能
int find_name(char strNameList[][2], char strLookUp[])
Run Code Online (Sandbox Code Playgroud)
我是C的新手(我是学生),我对字符串(字符串数组等)感到困惑.