0

It doesn't read the first line of the text file. Why?

pFile = fopen(user, "r");
    if(pFile == NULL)
    printf("File doesn't exist!\n");

    if(pFile != NULL){
    while(fgets(line,80,pFile) != NULL)
    {
    fgets(search,1000,pFile);
    printf("%s\n",line);
    .
    .
    .
    .
    .

Edited by Dani: Snippet accidentally removed when converting code snippet into question

2
Contributors
1
Reply
3
Views
6 Years
Discussion Span
Last Post by zeroliken
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.