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);
    .
    .
    .
    .
    .

It can read the first line just fine
quick question why are you using fgets twice?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.