|
i have a for loop like this
for(int i=0;i=3;i++)
{
cout<<"hello";
}
Ans :it works infinite times
can anybody explain me the reason for this for loop
|
|
|
|
|
Hint:
the expression
i=3;
evaluates to 3 , i.e. non-zero.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
Deepu Antony wrote: i=3;
try i==3; , or better yet 3==i;
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
It loops infinitely because i=3 (the conditional part of the for() loop) always evaluates to non-zero.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
Hi All,
I want to change some edit line to be read only but when i change the control properties i see that the control is in gray color -
I want that the control will stay in withe color - how can i do it ?
|
|
|
|
|
A read-only control and a disabled (gray) control are two different things. Which do you want?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I did not said anything about disable the control.
I mean readOnly.
|
|
|
|
|
You will have to color the control yourself.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
You may handle the WM_CTLCOLORSTATIC message in the Edit Box parent window.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
Hello every1.
I need to read the log file which is being updated every second and it is growing.
How do i have to approach that if i want to receive only 'newly' updated entries in the logfile rather than parsing it from the beggining?
Is there any good example how to do that?
|
|
|
|
|
Just store the end-of-file position, for instance (oversimplified standard C snippet)
last_pos = _lseek( fp, 0L, SEEK_END );
then, later on, start reading from recorded position
_lseek( fp, last_pos, SEEK_SET );
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
int01h wrote: ...i want to receive only 'newly' updated...
Since when?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
The last read, I suppose.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
Let me know, any opensource is available for OCR (Object Character Recognization)
|
|
|
|
|
|
Hi all,
I was trying to read a .exe file in binary format. For doing this i have read the file and then copied it in buffer. My buffer is in this variable
std::vector<unsigned char="">buf(sz);
</unsigned>
now my problem is i want to see that wether it has copied the content in buffer correctly or not.......and i am not not getting the way of doing this.......
|
|
|
|
|
neha.agarwal27 wrote: std::vectorbuf(sz);
?!?
neha.agarwal27 wrote: now my problem is i want to see that wether it has copied the content in buffer correctly or not.......and i am not not getting the way of doing this.......
I suppose you put the file content into a buffer. Now what do you want to do?
Check whether buffer content corrensponds to file one? validate the executable format? What else?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
ye i want to write it back in new file and see if it works same......
|
|
|
|
|
That is not a daunting task, just read the file inside a buffer and then write the buffer content into another file.
What exactly (of the above process) is difficult for you to implement?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
Actually exactly i want to find out that where exactly is version information of my file is given..
|
|
|
|
|
If your target is the executable version information resource then IMHO it is better to access it using standard API http://msdn2.microsoft.com/en-us/library/ms646981.aspx[^]
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
[my articles]
|
|
|
|
|
Hi,
I wanted to add Korean strings to the string table on my Visual C++ 6.0 editor. But, when I copy the Korean text and paste it on the editor, the Korean string appears as "??????". Can anybody help me out?
Thanks in advance,
AJ
|
|
|
|
|
Did you search on the codeproject? "multi language"
|
|
|
|
|
I had to select the correct language from the language bar to resolve it.
Thanks a lot!
|
|
|
|