|
int s=0;
int result[50];
string ggg[50];
i want stror result[s] in ggg[s]
|
|
|
|
|
std::ostringstream temp;
temp << result[s];
ggg[s] = temp.str();
Graham
Librarians rule, Ook!
|
|
|
|
|
thank you very much
modified on Sunday, June 8, 2008 3:04 AM
|
|
|
|
|
sofia_111 wrote: string ggg[50];
Are you sure this is what you want?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
i want compute result then store it in string but ok it excuted
thank you for all
|
|
|
|
|
but you're creating 50 strings ! not a string of 50 chars !! are you aware of this ?
|
|
|
|
|
Is it possible to convert a full c++ program into code?? And no, i am not rtrying to steal a program, its for my computer science course. I have a program, but i want to covert it to code, so i can 'fix' their code without rewriting the whole thing, cause my comp randomly sucks
"The beauty of Grace is that it makes life not fair" Relient K, Be my Escape
|
|
|
|
|
Interesting.
I went through your previous posts and it's quite clear that you have no clue about programming beyond a "Hello World" application. Now you want to decompile/disassemble an existing program (which is illegal by the way) and make us believe that it is an assignment from your computer course?
Even if you had permission to disassemble that program, it takes a very skilled person to go through 100000 lines of assembly code to figure out what each statement does.
Also, what does this mean:
Pathetic wrote: cause my comp randomly sucks
??
|
|
|
|
|
It means that my c++ program has a major error, and it randomly refuses to compile anything at all. And No, I am not a major illegal cheater. I am trying to recover the SPLATT!!! programs code throught the program
"The beauty of Grace is that it makes life not fair" Relient K, Be my Escape
|
|
|
|
|
Usually yes. However it is a daunting task, see http://en.wikipedia.org/wiki/Reverse_engineering[^] for some general info.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Try to complete you cource with hard work,not in this way.
-@SuDhIrKuMaR@-
|
|
|
|
|
Yea, but i am supposed to be 100% finished tommorrow
"The beauty of Grace is that it makes life not fair" Relient K, Be my Escape
|
|
|
|
|
how can i add two integers(numbers) without using + operator,rather by doing bit manupolation???
|
|
|
|
|
May I ask why you want to do that?
|
|
|
|
|
its my university assignment, in which we have to add 2 numbers but without + operator, can u help me in this?
|
|
|
|
|
In that case you should really do it yourself! You don't want to be caught cheating, do you?
|
|
|
|
|
yeah! but we really haven'nt been taught abt it...i m working abt it, if u dont wana help out then its ok.
thnx
|
|
|
|
|
Well it is not difficult to adapt the standard operation you do on paper with base-10 numbers to a base-2 system.
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.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
You can do this like, have two integers and a result integer.
For each input integer, check its bits from right to left(least significant bit to most)
If the bit value is one and same bit of resulting integer is zero, make resulting integer's bit to one.
If both are one then keep this bit's position, check which bit on left side of resulting integer value is zero, make it one and make other bits on right side until above kept position to zero.
Need to do for each integer input.
The process could be something like this or more easier, think yourself..
Thanks,
Suman
--
"Programming is an art that fights back!"
|
|
|
|
|
|
the algorithm for this is very short: basically, four operations in a loop.
some key points to think about:
if the binary representation of the two numbers you are adding do not have any 1 bits in common, addition is equivalent to a simple OR. 0x01 | 0x02 = 0x03, 0x08 | 0x03 = 0x0b (8 + 3 = 11 = 1000b + 0011b = 1011b). but, such a situation is the exception.
so, what do you do when numbers share bits?
(1 + 1 = 2)
0001b
0001b +
----------
0010b
(3 + 3 = 6)
0011b
0011b +
----------
0110b
(9 + 3 = 12)
1001b
0011b +
----------
1100b
see the pattern ?
1 + 1 = 2 but there is no 2 in base2, so put a zero, carry the one to the next column and do it again.
|
|
|
|
|
Using Visual C++ 6.0 MFC in SDI application
Under certain conditions I want my OnDraw routine to display a blank window, instead of what was previously drawn there. When I use the InvalidateRect(0) function, the OnDraw gets called, but I am looking for some window function that will clear everything. How do I do that?
Thanks
|
|
|
|
|
Why don't you put a flag in your OnDraw ()?
OnDraw ()
{
if (bBlank)
return;
Your Drawing code...
}
and bBlank = TRUE or FALSE as you need the blank window or not
Regards.
--------
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?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
The problem was that I would set a flag for my OnDraw routine to do as you suggested, but in the function that set that flag I simply did
flag = NOTDRAW;
Invalidate(0);
When I did this, with the OnDraw routine simply returning when it saw that flag, the old info in the client window would not be erased.
When I changed things to
Invalidate(0);
flag = NOTDRAW;
Invalidate(0);
in the function that set the flag, then the old info in the client window would get erased. So I'm confused as to what is happening with the Invalidate(0) function.
|
|
|
|
|
I am not sure why it happens. I usually use the Invalidate () without 0 and just afterwards an UpdateWindow (). It is supposed that Invalidate triggers the update, but I got used to that when I start coding in MFC because of some tutorials I used. The only problem with this is that depending on how much info is on the screen it can make it flick a bit.
Regards.
--------
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?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|