fopen - fscanf reads incorrect value ? -Xcode -


i've placed file.rtf in directory library/developer/xcode/deriveddata/test(projectname)/build/products/debug , code seems open prints out wrong output.the output 1606422622 integer value in file.

going through solutions of question similar mine ,the answers input file in right directory.i think i've done can't correct output.

desperate help.thanks.

int main() {   int b;   file *fp;   fp=fopen("file.rtf","r");   if (fp == null) {     printf( "file doesn't exist!\n");   }   fscanf(fp,"%i",&b);   printf("%i\n",b);    fclose(fp);   } 

looks trying read rtf formatted file. try saving file 'plain text file' in textedit. (with extension .txt)

enter image description here


Comments

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

monitor web browser programmatically in Android? -

c# - Using multiple datasets in RDLC -