You are viewing our Forum Archives. To view or take place in current topics click here.
c++ help!!!!!!!!!!!!
Posted:
c++ help!!!!!!!!!!!!Posted:
Status: Offline
Joined: Feb 21, 201410Year Member
Posts: 123
Reputation Power: 4
Status: Offline
Joined: Feb 21, 201410Year Member
Posts: 123
Reputation Power: 4
I need help with some c++. I know this is probably not the right form but the programming form is dead so i decided to ask here. I am making a ascii art image and i have three images but everytime so matter what i type as the input it goes strait to the else. I do not know why but i really need help.
#2. Posted:
Status: Offline
Joined: Feb 18, 201212Year Member
Posts: 773
Reputation Power: 32
P.M. your code. I'll take a look at it right now
- 0useful
- 0not useful
#3. Posted:
Status: Offline
Joined: Feb 18, 201212Year Member
Posts: 773
Reputation Power: 32
It is always good practice to use methods to compare strings since they are not primitive data types.
So instead of using
Use this!
I hope I have helped!
So instead of using
if(inputString == "Happy Holidays!")
{
}
Use this!
if(strcmp(inputString, "Happy Holidays!") == 0)
{
//They are the same!
}
I hope I have helped!
- 0useful
- 0not useful
#4. Posted:
Status: Offline
Joined: Feb 21, 201410Year Member
Posts: 123
Reputation Power: 4
Status: Offline
Joined: Feb 21, 201410Year Member
Posts: 123
Reputation Power: 4
thanks
202020002020202020
202020002020202020
- 0useful
- 0not useful
#5. Posted:
Status: Offline
Joined: Sep 08, 201212Year Member
Posts: 5,209
Reputation Power: 5546
Status: Offline
Joined: Sep 08, 201212Year Member
Posts: 5,209
Reputation Power: 5546
RC4 wrote It is always good practice to use methods to compare strings since they are not primitive data types.
So instead of using
if(inputString == "Happy Holidays!")
{
}
Use this!
if(strcmp(inputString, "Happy Holidays!") == 0)
{
//They are the same!
}
I hope I have helped!
You seem to know your stuff good job
- 0useful
- 0not useful
#6. Posted:
Status: Offline
Joined: Feb 21, 201410Year Member
Posts: 123
Reputation Power: 4
Status: Offline
Joined: Feb 21, 201410Year Member
Posts: 123
Reputation Power: 4
ok, now it shows the input image but it also shows the else image i am not sure what to do?
- 0useful
- 0not useful
You are viewing our Forum Archives. To view or take place in current topics click here.