Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

c under unix

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
we have linux os i want to write c programs under linux
i know linux commands tell me how to start
 
Are you familiar with the c language? The compiler is gcc or g++ for c++. Say you had a hello.c file, to compile you would type: 'gcc hello.c'. This will produce the executable file 'a.out'. To run it, type: './a.out'.
 
i tried for a program to eliminate comment lines from a file
can any body help with a source code mine doesn't work
 
Hope this would help des12...try scanning the file char by char...i mean read the file character by character and write it to a new file...check if the character is '/'...
Case 1 : if the next character is '*' then don't dont write characters that follow till you encounter a '*' followed by '/'
Case 2 : if the next character is '/' then don't write characters that follow till you encounter a new line character '\n'
At last remove the original file and rename the new file
Think you wont need any code
Regards
Ekanth Treat the daily build of a project as the heartbeat of the project. If there's no heartbeat the project is dead.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top