need help with c


 
Thread Tools Search this Thread
Top Forums Programming need help with c
# 8  
Old 02-26-2010
need help with the troublesome c

i have changed the comment style , but i am still having the same problem

minix = assassin

please help me guys
# 9  
Old 02-26-2010
Using fgets function

Quote:

Use this following code, it will give you the last line of the file content
Here I have implemented, Franklin idea.

Code:
 

#include<stdio.h>
#include<string.h>

main()
{
        FILE *fp ;
        char line[80];
        char temp[80];
        fp = fopen ("text","r") ;  // Open the file
        while (fgets (line,80,fp)!= NULL );
        printf ( "%s",line ) ; // displaying the last line
}

# 10  
Old 02-27-2010
Quote:
Originally Posted by pludi
The reason is this: correct ANSI C doesn't support the double-slash comments, since those were originally introduced by C++. So if your compiler is very strict about this (and you being on Minix this might well be) it will fail on those.
That's not true? ANSI as adopted ISO/IEC 9899:1999, and // comment style is supported by ISO C99.

I know, people use to think of "ANSI C" as ISO/IEC 9899:1990, but this is strictly speaking wrong since many years Smilie

Cheers,
Loïc
Login or Register to Ask a Question

Previous Thread | Next Thread
Login or Register to Ask a Question