|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
i'm in hurry please help ! c++ builder file reading
firs of all i'm sory for my english (i'm still lerning)
my problem looks like that ... i have a file , it's structure looks like that : H1 : something H2 : something H3 : smoething etc.... for example : i neet to take from the string two first signs and check if it is a "H3" and if it is ....i have to read the rest of line placed behind ":" ... how to do it...we have to open the file as a binary .... |
|
#2
|
|||
|
|||
|
You could use getline() to read in the first two chars, and then a simple if statement can be used to determine if the variable you read the first two char's into equals "H3". If it does, read the rest of the line, else skip to the next line--you can do that with cin.ignore() or by reading the rest of the line into a dummy variable that you don't use.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages > C Programming > i'm in hurry please help ! c++ builder file reading |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|