Is there an ansi c function equivelant to the c++ getline function? The only way I can think of to do this is to use the read system call (on linux), but I wouldn't know what to do if I were trying to read a line on another system.
Is there an ansi c function equivelant to the c++ getline function? The only way I can think of to do this is to use the read system call (on linux), but I wouldn't know what to do if I were trying to read a line on another system.
Use fgets()
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
sorry I wasn't clear in my initial post. I'm reading from the command line.
7. It is easier to write an incorrect program than understand a correct one.
40. There are two ways to write error-free programs; only the third one works.*