c code to find the line number in the function argument string

    #include<stdio.h>     #include<string.h>     unsigned int FindFunctionDefn( const char* strFunctionName, const char*      strSourceCode ){     int n = strlen(strSourceCode);     int m = strlen(strFunctionName);     int i = 0;     unsigned int  line = 0;     char new[300];     strcpy(new,"");     int p;     char u[1];     for(i=0;i<n;i++)     {   if (strSourceCode[i]!='\n'){     u[0] = strSourceCode[i];     strcat(new,u);     }      if (strSourceCode[i] == '\n'){     line = line + 1;     p=strstr(new,strFunctionName);     printf("%d",p);     if (p!=NULL){     printf("%s \n",p);     printf("%u",line);     return line;     }      else     {     strcpy(new,"");     }     }      }      }            int main(int argc, const char * argv[]){     const char strFunctionName[] = "func2";     const char strSourceCode[] =  "int func1(){ return 0; }\n int      func2(){ return 1; }\n" "int main(int argc, char*argv[]){ return      func2(); }\n";     FindFunctionDefn( strFunctionName, strSourceCode );     }       [![this is the code in codeblock[![\]\[1\]][1]][1]][1] 

the following C function: unsigned int FindFunctionDefn( const char* strFunctionName, const char* strSourceCode ); FindFunctionDefn takes two strings as inputs: a function name and a program string; it returns as an output the line number that contains the function definition (differentiate this with the function calls) in the program string. The program string is a valid C code; it contains a character “\n” indicate the end of a line with the line number starts from one. The program string is guaranteed not to contain any C (or C++) comments. The function FindFunctionDefn returns 0 if it fails to find the function definition. For example, char strFunctionName[] = “func2”; char strSourceCode[] = “int func1(){ return 0; }\n int func2(){ return 1; }\n” “int main(int argc, char*argv[]){ return func2(); }\n”; FindFunctionDefn( strFunctionName, strSourceCode ) should return 2. but i am not getting any output please clarify what have i done wrong thanks