473,563 Members | 2,735 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Plz Help Me To Modify Program...

2 New Member
i've tried run this program many times but i still didn't get the solution..so could someone help me to modify this coding?

Expand|Select|Wrap|Line Numbers
  1.   current->h10 += hp10;
  2.   current->h30 += hp30;
  3.   current->c10 += cp10;
  4.   current->c30 += cp30;
  5.   current->d10 += dp10;
  6.   current->d30 += dp30;
the output should add the current value with the new user input. for example, if the current value is 1 and the user input also 1. the answer should be 2..but what i got with this coding was 11..
Oct 12 '06 #1
4 1529
dariophoenix
34 New Member
Perhaps if you put the entire code, or explain... I don't know which is which
Oct 12 '06 #2
apusateri
27 New Member
i've tried run this program many times but i still didn't get the solution..so could someone help me to modify this coding?

Expand|Select|Wrap|Line Numbers
  1.   current->h10 += hp10;
  2.   current->h30 += hp30;
  3.   current->c10 += cp10;
  4.   current->c30 += cp30;
  5.   current->d10 += dp10;
  6.   current->d30 += dp30;
the output should add the current value with the new user input. for example, if the current value is 1 and the user input also 1. the answer should be 2..but what i got with this coding was 11..
Do you have your variables set up as integers? int 1 + int 1 = 2, but char 1 + char 1 = 11... Other than that, I agree with the previous comment, I'd like to see some more code to know what is going on here. That was just a "quick check" I wanted to offer.
Oct 12 '06 #3
Banfa
9,065 Recognized Expert Moderator Expert
int 1 + int 1 = 2, but char 1 + char 1 = 11
No char 1 + char 1 = 2 as well

You may be thinking of

string "1" + string "1" = "11"

or

string "1" + char '1' = "11"
Oct 12 '06 #4
apusateri
27 New Member
No char 1 + char 1 = 2 as well

You may be thinking of

string "1" + string "1" = "11"

or

string "1" + char '1' = "11"
You're right, meant to say string.

My mistake.
Oct 12 '06 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
4465
by: Franco Fellico' | last post by:
Hi. Suppose to have read and displayed (using PHP) a group of row of a DB table on a dinamyc table on a HTML/PHP page. The number of row displayed could be from 1 to n. Each row contains informations and also a cell with a unique ID of the element. I would like to show at the beginning of each line of the table a couple of cells...
0
2402
by: Chris McKeever | last post by:
I am trying to modify the Mailman Python code to stop mapping MIME-types and use the extension of the attachment instead. I am pretty much clueless as to what I need to do here, but I think I have narrowed it down to the Scrubber.py file.. If this seems like a quick step me through, I would be very appreciative, could get you something on...
20
2053
by: CoolPint | last post by:
While I was reading about const_cast, I got curious and wanted to know if I could modify a constant variable through a pointer which has been "const_cast"ed. Since the pointer would be pointing to the constant variable and if I changed the value through the pointer, the constant variable should have been modified. Well, that's what I thought...
4
1741
by: Markus Dehmann | last post by:
I guess this is a kind of newbie question (since most pointer questions are newbie questions). In the program below, modify(string* s) is supposed to change the content that s points to. But the main() function shows that nothing is changed at all! What am I doing wrong?
28
12532
by: Charles Sullivan | last post by:
I'm working on a program which has a "tree" of command line arguments, i.e., myprogram level1 ]] such that there can be more than one level2 argument for each level1 argument and more than one level3 argument for each level2 argument, etc. Suppose I code it similar to this fragment: int main( int argc, char *argv ) {
13
2500
by: baumann.Pan | last post by:
when define char *p = " can not modify"; p ='b' ;is not allowed, but if you declare p as char p = "can modify"; p = 'b'; is ok? why?
2
4781
by: Daniel Mark | last post by:
Hello all: I installed IPython on my XP machine today and find that my sys.path has been changed as follows:
4
1531
by: Alan Silver | last post by:
Hello, Is it possible to modify the templates that come with VS2005? I have searched all over the place, but can't find them anywhere. I know I can make my own, but I would like to know if I can modify the ones that are already there. TIA --
3
1938
by: TonyJ | last post by:
Hello! I supposed to modify some text files. In the file(s) which consist of different section. In one section you might have Path = <Installation_path>. The program will then replace the text string Installation_path with the path that was chosen in the installation program. An example could be this string <Installation_pathwould be...
0
1540
sreekandank
by: sreekandank | last post by:
Hi..... I have done the program for simple chat application in java....as given below.... server.java import java.net.*; import java.io.*; public class server { public static void main(String args)throws Exception
0
7580
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7882
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7945
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6244
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5481
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5208
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3634
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3618
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1194
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.