You are viewing our Forum Archives. To view or take place in current topics click here.
c++ help!!!!!!!!!!!!
Posted:

c++ help!!!!!!!!!!!!Posted:

AVeRageModz
  • Challenger
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:
RC4
  • Rising Star
Status: Offline
Joined: Feb 18, 201212Year Member
Posts: 773
Reputation Power: 32
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
#3. Posted:
RC4
  • Rising Star
Status: Offline
Joined: Feb 18, 201212Year Member
Posts: 773
Reputation Power: 32
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

if(inputString == "Happy Holidays!")
{
   
}


Use this!

if(strcmp(inputString, "Happy Holidays!") == 0)
{
    //They are the same!
}


I hope I have helped!
#4. Posted:
AVeRageModz
  • Challenger
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
#5. Posted:
Owen
  • Spooky Poster
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
#6. Posted:
AVeRageModz
  • Challenger
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?
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.