![]() |
|
#1
|
|||
|
|||
Problem putting variables cumulatively into a string,Im tryin to create a calculator where u can put the number in by typing or by press buttons. I have a problem when i try get the input of the buttons into the string. The code is very long and poor coz im not sure how to shorten it until i get everything sorted, so iv eft the chucks out of code that are just repeats of the above lines. How do i get a string to accept each term cumulatively so i can have a multi-digit number?
CPP / C++ / C Code:
Last edited by dsmith : 05-Feb-2004 at 07:24.
Reason: Changed code keyword to c keyword
|
|
#2
|
||||
|
||||
|
Quote:
Hi Warny. I hate to answer a question with a question, but I am having a little trouble following what you are doing. If you have a complete string that is a number, you can convert that entire string to a double (or long or int) by using on of the following CPP / C++ / C Code:
These are all defined in the stdlib.h header file. I am not sure if this helps or not as I had a little trouble figuring out your question. Incidently, I am writing a library that will parse an entire string that I hope to post this weekend sometime. It is based upon the discussion in this thread. I am not sure if this is something that you would be interested in or not. Anyway, good luck! |
|
#3
|
||||
|
||||
|
warny_maelstrom
i try to compile the program that u post at above i not sure is my compile did not support ur code "winio" what is winio ?? can u explain it to me |
|
#4
|
|||
|
|||
|
dsmith, im tryin to get so that when someone presses more than one button that iv created that i get a string of numbers as an input rather than just changing the original number. eg. user presses button[1], number 1 appears in the "First Number" box, then when they press button[4] only number 4 appears where as i would like 14 to appear and b the input once the user clicks the appropriate button.
At the moment it works fine if only suming 2 single digit numbers together but i really want to b able to use bigger numbers. tay:-Iv only been doin programmin for a month or two so im not completely sure but its windows input output, i think it lets u open a windows box instead of the normal crap black dos-prompt type box that normally comes up when u run a program. Check if u have the windows.h program within ur libary coz that might b the problem, if u do take out the "#pragma windows 300000,500000,"cwp_ico.rc"" bit coz im not sure where this comes from i only know wot it does and its just aesthetics. |
Recent GIDBlog
Toyota - 2008 September Promotion by Nihal
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The