Comments in an Input File
Author |
Message |
corriep
|
Posted: Fri Dec 05, 2008 8:17 pm Post subject: Comments in an Input File |
|
|
Lets say I have an input file with >100 lines all full of numbers.
Is it possible to put comments in the input file that the program can't read? If not, is there an alternative?
Any help would be greatly appreciated. |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: Fri Dec 05, 2008 8:49 pm Post subject: RE:Comments in an Input File |
|
|
Your program will read all of the input, but you can build the program in such a way that it ignores certain type of input. The design is really up to you.
A super easy solution (for this case) is to read everything in as a string, and then figure out if it's a number or anything else using strintok() |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
corriep
|
Posted: Fri Dec 05, 2008 9:29 pm Post subject: RE:Comments in an Input File |
|
|
Thanks tony!
Never even thought to use strint. The best part is that I don't have to use // or % or /* and */.
It seems so easy now. |
|
|
|
|
![](images/spacer.gif) |
|
|