Click here to Skip to main content
15,919,749 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCamera Capture Utility Pin
Programm3r25-Jul-07 1:08
Programm3r25-Jul-07 1:08 
AnswerRe: Camera Capture Utility Pin
Adno25-Jul-07 10:13
Adno25-Jul-07 10:13 
QuestionConversion problem Pin
Suneet.0325-Jul-07 0:52
Suneet.0325-Jul-07 0:52 
AnswerRe: Conversion problem Pin
Rage25-Jul-07 1:29
professionalRage25-Jul-07 1:29 
AnswerRe: Conversion problem Pin
Mark Salsbery25-Jul-07 5:45
Mark Salsbery25-Jul-07 5:45 
QuestionConditional break point on CString object is not working? Pin
Mushtaque Nizamani25-Jul-07 0:03
Mushtaque Nizamani25-Jul-07 0:03 
GeneralRe: Conditional break point on CString object is not working? Pin
Matthew Faithfull25-Jul-07 0:34
Matthew Faithfull25-Jul-07 0:34 
Question(Beginner) Explanations about rewind, eof(), reading a file several times [modified] Pin
garfaoui24-Jul-07 23:57
garfaoui24-Jul-07 23:57 
Hello everybody,
I am a beginner in programming c++.Smile | :) I have to do a programm that compare a model file to another file (txt files), and if the beginnings of the files are the same, then i have to rename the file compared. This programme works, but i have to compare more than one file with the model file. Therefore i have copied and pasted the following programme several times in the programme:


//Début de la lecture:<br />
a=0;<br />
vadves.open("vadves.txt",ios::in);<br />
//Ouverture du flux de lecture fichier:<br />
fstream fichier10;<br />
fichier10.open("ICET0R.WZT.MXS.G0900V00.G2307215",ios::in);<br />
for (i=1;i<=55;i=i+1) {<br />
               vadves>>c;<br />
               fichier10>>c;<br />
               }<br />
while(a==0) {<br />
              vadves>>c;<br />
              fichier10>>t;<br />
              if (c==t&&!fichier10.eof()) {<br />
                                a=0;                                                    // Si les caractères sont identiques alors on continue la lecture<br />
                         } else { if (vadves.eof()) {         // Si le caractere lu dans le fichier a reconnaitre est la butée<br />
                                               a=2;      <br />
                                } else { a=1;<br />
                                       }<br />
                                }       <br />
<br />
}<br />
vadves.close();<br />
fichier10.close();<br />
if (a==1) {<br />
          cout<<"fichier10 is not vadves";<br />
          }<br />
if (a==2) {<br />
          cout<<"fichier10 is vadves";<br />
          rename("ICET0R.WZT.MXS.G0900V00.G2307215", ostr.str().c_str());<br />
          }


But i have conclude that once the file model (vadves.txt) has been read i can´t re-read it, even if i close and open the flow vadves.
Therefore, i thought about keeping open the flow vadves and rewinding it. But i don´t know how to use the command rewind, i also heard about fstream command...Sigh | :sigh:

Moreover, the file to compar has a name which change every day but always begin with "ICETOR". So is there a command or a programme that could find and associate their name to a value that i could use in my programme?Confused | :confused: The best command would translate: "for every file beginning whose name begin with ICETOR do ..."

I would be very thankful if somebody could help me Roll eyes | :rolleyes:
It has been 3 days that i am on this programme... and i am starting to be fed up with it ... Sigh | :sigh:

Deep thanks

Guillaume
AnswerRe: (Beginner) Explanations about rewind, eof(), reading a file several times Pin
Rage25-Jul-07 1:35
professionalRage25-Jul-07 1:35 
GeneralRe: (Beginner) Explanations about rewind, eof(), reading a file several times Pin
garfaoui25-Jul-07 2:09
garfaoui25-Jul-07 2:09 
QuestionRe: (Beginner) Explanations about rewind, eof(), reading a file several times Pin
garfaoui25-Jul-07 2:20
garfaoui25-Jul-07 2:20 
AnswerRe: (Beginner) Explanations about rewind, eof(), reading a file several times Pin
Paresh Chitte25-Jul-07 2:32
Paresh Chitte25-Jul-07 2:32 
AnswerRe: (Beginner) Explanations about rewind, eof(), reading a file several times Pin
David Crow25-Jul-07 2:44
David Crow25-Jul-07 2:44 
QuestionRe: (Beginner) Explanations about rewind, eof(), reading a file several times Pin
David Crow25-Jul-07 2:50
David Crow25-Jul-07 2:50 
AnswerRe: (Beginner) Explanations about rewind, eof(), reading a file several times Pin
garfaoui25-Jul-07 5:25
garfaoui25-Jul-07 5:25 
GeneralRe: (Beginner) Explanations about rewind, eof(), reading a file several times Pin
David Crow25-Jul-07 5:35
David Crow25-Jul-07 5:35 
NewsRe: (Beginner) Explanations about rewind, eof(), reading a file several times Pin
garfaoui25-Jul-07 21:24
garfaoui25-Jul-07 21:24 
QuestionCString to char conversion Pin
pete007_ke24-Jul-07 22:43
pete007_ke24-Jul-07 22:43 
AnswerRe: CString to char conversion Pin
jhwurmbach24-Jul-07 23:37
jhwurmbach24-Jul-07 23:37 
GeneralRe: CString to char conversion Pin
pete007_ke25-Jul-07 1:03
pete007_ke25-Jul-07 1:03 
Question"Language for non-Unicode programs " affects my unicode program Pin
code_discuss24-Jul-07 22:02
code_discuss24-Jul-07 22:02 
GeneralRe: "Language for non-Unicode programs " affects my unicode program Pin
Matthew Faithfull25-Jul-07 0:54
Matthew Faithfull25-Jul-07 0:54 
QuestionCreating folder in start menu with a dot(.) at end. Pin
Y K Kishore Kumar24-Jul-07 21:57
Y K Kishore Kumar24-Jul-07 21:57 
AnswerRe: Creating folder in start menu with a dot(.) at end. Pin
Jonathan [Darka]24-Jul-07 22:46
professionalJonathan [Darka]24-Jul-07 22:46 
GeneralRe: Creating folder in start menu with a dot(.) at end. Pin
Y K Kishore Kumar24-Jul-07 23:17
Y K Kishore Kumar24-Jul-07 23:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.