473,499 Members | 1,548 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 1521
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
4459
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...
0
2396
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...
20
2043
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...
4
1735
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...
28
12481
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...
13
2492
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
4770
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
1527
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...
3
1933
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...
0
1536
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...
0
7126
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7005
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...
0
7168
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,...
0
7210
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6891
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5465
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,...
1
4916
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...
0
1424
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
659
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.