You can use pointers. It is the fastest and the best solution.
Type: Posts; User: sunny1778
You can use pointers. It is the fastest and the best solution.
Hi,
Try out this piece of code. It should work for you.
char buf[1000];
FILE *fp;
fp = fopen("myfile.txt","r");
"Understanding Pointers in C" by Yashwant Kanetkar.
Its a very nice book, contains nice examples and easy to understand. It is best for the beginners.
This might be due to printf statements, because printf statements return int (i.e. no of characters printed). So, just use "return;" in the end. It should solve the problem.
You can use strcmp. Its short and simple. Just put an extra check for buffer overflow.
Are you able to see 00, 01, 02 ... for "rank"?
It seems like "ptr" is not assigned properly. Please check its assignment.