|
I have tryed that:
c0..c3 and f01..f31 are declared as string (include < string >)<br />
<br />
getline(file1,c0);
getline(file1,c1); <br />
getline(file1,c2);<br />
getline(file1,c3);<br />
<br />
getline(file2,f01);
getline(file2,f11); <br />
getline(file2,f21);<br />
getline(file2,f31);<br />
<br />
if(f11==c1&&f21==c2&&f31==c3) <br />
{a1=1;}
But the thing is that i have to do that for 11 files. I think there is a problem with getline. I don´t know how to see the ´size´ of a line. Maybe the programme doesn´t considerer a line as a line in the text file.
|
|
|
|
|
From VC++ Help:
These functions extract data from an input stream as follows:
Variation Description
get();
Extracts a single character from the stream and returns it.
get( char*, int, char );
Extracts characters from the stream until either delim is found, the limit nCount is reached, or the end of file is reached. The characters are stored in the array followed by a null terminator.
get( char& );
Extracts a single character from the stream and stores it as specified by the reference argument.
get( streambuf&, char );
Gets characters from the stream and stores them in a streambuf object until the delimiter is found or the end of the file is reached. The ios::failbit flag is set if the streambuf output operation fails.
On the other hand...
istream& read( char* pch, int nCount );
istream& read( unsigned char* puch, int nCount );
istream& read( signed char* psch, int nCount );
Parameters
pch, puch, psch
A pointer to a character array.
nCount
The maximum number of characters to read.
Remarks
Extracts bytes from the stream until the limit nCount is reached or until the end of file is reached. The read function is useful for binary stream input.
Maybe one of this other options is better for you.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
THANK YOU!
That´s exactely what i needed! i am using dev c++ and i don´t have a help file about commands...
|
|
|
|
|
garfaoui wrote: i am using dev c++ and i don´t have a help file about commands...
But you do use the online-Version of the MSDN[^], do you?
Failure is not an option - it's built right in.
|
|
|
|
|
no i didn´t know this site. Thank you very much, i added this site to my favorites ^^
|
|
|
|
|
If you are only interested in comparing the first 114 characters of the file, and you don't care what those differences are, why not just read that much of each file into a buffer and then compare the whole buffer using memcmp() ?
"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
|
|
|
|
|
because i don´t know this command and what a buffer is. In fact i did 30hours of programmation that´s all.
|
|
|
|
|
garfaoui wrote: In fact i did 30hours of programmation that´s all.
Sounds like you might need to get a refund.
"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
|
|
|
|
|
i would like that, but i did it at school... so it s hard to get a refund... Anyway i am not going to be a programmer. I am doing this programm to help a company that´s all.
|
|
|
|
|
Be carefull that the "bug" doesn't bite you... if you start to like it... you are lost :P
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
|
Eing ???
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
Could you be a bit more clear with your query. Like are you developing an Application or this is the problem with some installed application. Is it MDI/SDI.
Please I request all posters to go through the Guideline Chris has posted at the first message in VC++ Forum. Please make use of it and get proper answers. We are here to help but to those who show some initiatives.
There are only two kinds of people who are really fascinating-people who know absolutely everything, and people who know absolutely nothing.
Oscar Wilde (1854-1900)
Regards...
Shouvik
|
|
|
|
|
shouvik.d wrote: Please I request all posters to go through the Guideline Chris has posted at the first message in VC++ Forum.
A much more verbose guideline can be found here. Folks would do well to read either.
"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
|
|
|
|
|
Hehehe,
it seems that not, he could not be a bit more clearer :P
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
Why you delete your message?
|
|
|
|
|
Hi all,
I need to know application and window details which is about to activate when a user clicks on the Taskbar.
After using spyxx and implementing win32 Mouse and CBT hooks I come to know that the clicks on taskbar window is actually recieved by "Running Application" Window which is child of RebarWindow. and that window belongs to explorer.exe.
How I can identify clicks on button and know which application is about to activate?
Thanks in advance
|
|
|
|
|
The button that you talk about belongs to which application ?
|
|
|
|
|
Hi
How can I change the position of the dialog box which is created from CFileDialog? This is not work;
TCHAR strFilter[] = { TEXT("Files (*.*)|*.*||") };<br />
CFileDialog dlg(TRUE, TEXT(".*"), NULL, 0, strFilter,this);<br />
dlg.SetWindowPos(&wndTop,0,0,20,30,SWP_SHOWWINDOW);
Thanks
|
|
|
|
|
iayd wrote: This is not work;
Because, you are using API, on uninitialized window.
Try to create it modelles. If you want it modal, then derive a class from CFileDialog and use SetWindowPos or MoveWindow in OnInitDialog .
Prasad
MS MVP - VC++
|
|
|
|
|
But still I cannot change the width of dialog box.I want a narrower diialog box.I used SetwindowPos in OnInitDialog.Is there a solution for this problem.
|
|
|
|
|
As told earlier, MoveWindow or API mentioned by you can be used. Make sure, you are using these API's after initialization of window handle.
Prasad
MS MVP - VC++
|
|
|
|
|
Modeless or modal, this will not work. You'll need to provide a hook (OFN_ENABLEHOOK ). In that hook procedure, respond to the WM_INITDIALOG message, and call SetWindowPos() .
"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
|
|
|
|
|
Hoe will I do waht you said?Can you write a sample code?
Thanks
|
|
|
|
|
See here.
"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
|
|
|
|