|
What I mentioned was a completely different issue. I asked if you had flushed the buffer, but you haven't answered that question.
Also, your iterator has nothing to do with the char variable. The iterator would contain the ifstream objects.
|
|
|
|
|
Cyrilix wrote: I asked if you had flushed the buffer
Why would I have to flush the buffer ? AFAIK, the >> operator does not require the buffer to be flushed !! As a proof of it, if I do the same on a single fstream without the vector, it works perfectly !
Cyrilix wrote: your iterator has nothing to do with the char variable. The iterator would contain the ifstream objects
Of course. I never mentioned the iterator should coutain char variables ?!
|
|
|
|
|
Rage wrote: std::vector<fstream> vFilestreams;
Can you change that to <fstream*> and try? btw,you push fstream object straight into the vector? it did compile for you? what compiler are you using?
He's become a household word in the Lounge. A whole new phraseology has evolved. Post a link or reply with a smiley and rose, and you've made a "Satipsism". So what? It's an interesting thing about the Internet, the evolution (as in change, not progress) of tone, quality, terminology, etc.
-Marc Clifton.
Best wishes to Rexx[^
|
|
|
|
|
i don't see anything wrong in using directly a vector of fstream, except perhaps that they will get copied and then decrease the performances... but of course it would compile.
|
|
|
|
|
It could compile on a VC 6.0(We know about mr6 ), but it wont work ultimately. so should be his problem.
He's become a household word in the Lounge. A whole new phraseology has evolved. Post a link or reply with a smiley and rose, and you've made a "Satipsism". So what? It's an interesting thing about the Internet, the evolution (as in change, not progress) of tone, quality, terminology, etc.
-Marc Clifton.
Best wishes to Rexx[^
|
|
|
|
|
VuNic wrote: btw,you push fstream object straight into the vector?
Yes
VuNic wrote: it did compile for you? what compiler are you using?
Obviously. VC6.
|
|
|
|
|
essayer ca! hehe jus a rough idea! optimize it.
<code>
char current_char[200];
vector <fstream*>::iterator vi;
std::vector<fstream*> vFilestreams;
std::vector<string> vFileList;
int i=0;
vFileList.push_back("c:\\test.txt");
fstream fs2;
fstream* fs =&fs2;
vFilestreams.push_back(fs);
for (vi=vFilestreams.begin(); vi!=vFilestreams.end(); vi++)
{
(*vi)->open(vFileList[i].c_str(),ios::in);
}
for (int j=1;j<=20;j++)
{
for (vi=vFilestreams.begin(); vi!=vFilestreams.end(); vi++)
{
(**vi)>>current_char;
AfxMessageBox(current_char);
}
}
</code>
He's become a household word in the Lounge. A whole new phraseology has evolved. Post a link or reply with a smiley and rose, and you've made a "Satipsism". So what? It's an interesting thing about the Internet, the evolution (as in change, not progress) of tone, quality, terminology, etc.
-Marc Clifton.
Best wishes to Rexx[^
|
|
|
|
|
Thanks, I'll give this a try.
|
|
|
|
|
Guys,
I am writing a program that permits the user to launch paint from within my application if he/she chooses. Since my program must support a wide range of Windows OSs, I am faced with the dilemma that paint is located in different folders in different OSs. My question is, can I use the environment variable %SystemRoot% when specifying the location to launch?
For example: C:\\%SystemRoot%\\System32\\mspaint.exe
If this isn't the way to do it, any suggestions of a good way to do this?
|
|
|
|
|
If mspaint.exe consistently lives in the System32 folder, why bother with specifying the path? In other words, have you encountered a machine where typing mspaint.exe in the Run box did not work?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
as David said, i doubt very strongly that mspaint.exe is not in the system path... so just launch mspaint as you launch notepad , and you'll be gone
|
|
|
|
|
|
yokel
|
|
|
|
|
Just noticed, well, after being told anyway.
Bows head in shame.
|
|
|
|
|
Toi qui connais bien les STL, une idée concernant cela :
http://www.codeproject.com/script/comments/forums.asp?msg=2162202&forumid=1647&mode=all&userid=29249#xx2162202xx
On ne peut pas stocker de fstream dans un vector ?
|
|
|
|
|
Rage wrote: On ne peut pas stocker de fstream dans un vector ?
Je pense que , on ne peux pas ! , tu peux montrer les codes que tu utilise a stoker de fstream dans un vector ?
He's become a household word in the Lounge. A whole new phraseology has evolved. Post a link or reply with a smiley and rose, and you've made a "Satipsism". So what? It's an interesting thing about the Internet, the evolution (as in change, not progress) of tone, quality, terminology, etc.
-Marc Clifton.
Best wishes to Rexx[^
|
|
|
|
|
Learning French ? I didn't know that you could speak...
|
|
|
|
|
oui bro je la parle tres bien :->;)
He's become a household word in the Lounge. A whole new phraseology has evolved. Post a link or reply with a smiley and rose, and you've made a "Satipsism". So what? It's an interesting thing about the Internet, the evolution (as in change, not progress) of tone, quality, terminology, etc.
-Marc Clifton.
Best wishes to Rexx[^
|
|
|
|
|
hum, sauf que des fstream dans un vector, c'est possible ! pourquoi ce ne le serait pas d'ailleurs ?!
|
|
|
|
|
toxcct wrote: c'est possible !
faux! possible suelment pour les pointers a la fstream.
He's become a household word in the Lounge. A whole new phraseology has evolved. Post a link or reply with a smiley and rose, and you've made a "Satipsism". So what? It's an interesting thing about the Internet, the evolution (as in change, not progress) of tone, quality, terminology, etc.
-Marc Clifton.
Best wishes to Rexx[^
|
|
|
|
|
|
Proof[^]
He's become a household word in the Lounge. A whole new phraseology has evolved. Post a link or reply with a smiley and rose, and you've made a "Satipsism". So what? It's an interesting thing about the Internet, the evolution (as in change, not progress) of tone, quality, terminology, etc.
-Marc Clifton.
Best wishes to Rexx[^
|
|
|
|
|
(Note: the above is not blank, I am signing using French signs. Does not translate well to a forum, I guess...)
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
James R. Twine wrote: (Note: the above is not blank, I am signing using French signs. Does not translate well to a forum, I guess...)
French please. I dont understand english.
He's become a household word in the Lounge. A whole new phraseology has evolved. Post a link or reply with a smiley and rose, and you've made a "Satipsism". So what? It's an interesting thing about the Internet, the evolution (as in change, not progress) of tone, quality, terminology, etc.
-Marc Clifton.
Best wishes to Rexx[^
|
|
|
|
|
VuNic wrote: French please. I dont understand english.
HOW DARE you WRITE IN HINDI then ................;P
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief
|
|
|
|