Re: beginner string question
From: Sonoman (fcarpio_at_cse.fau.edu)
Date: 11/12/03
- Next message: .oO LGV Oo.: "Re: Palindrome (HELP)"
- Previous message: Chris Theis: "Re: Palindrome (HELP)"
- In reply to: Sonoman: "beginner string question"
- Next in thread: Peter van Merkerk: "Re: beginner string question"
- Reply: Peter van Merkerk: "Re: beginner string question"
- Reply: Jon Bell: "Re: beginner string question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 12 Nov 2003 04:41:59 -0500
Sorry but I gave the wrong info, I declared "temp" as a character array if
that makes a difference. I did use strings but they were breaking up in
between spaces, so now I am using getline() with char[] arrays.
"Sonoman" <fcarpio@cse.fau.edu> wrote in message
news:Skksb.11179$jA6.6383@bignews6.bellsouth.net...
> I am trying to do this:
>
> cin >> temp;
> if (temp == "n"){
> Then do something...
> }
>
> temp was declared as a string and the input I give at the prompt is n, but
> it skips the condition for the if statement when I think it should go into
> the if statement. I tried swithching to 'n' for the condition but it gave
me
> a compile error. The complete code is here:
>
> http://www.cse.fau.edu/~fcarpio/
>
> and the offending lines are in the person.cpp file line 66. I know it must
> be something simple, but I am failing to see it. There is no compiler
error.
>
> Thanks in advance.
>
>
- Next message: .oO LGV Oo.: "Re: Palindrome (HELP)"
- Previous message: Chris Theis: "Re: Palindrome (HELP)"
- In reply to: Sonoman: "beginner string question"
- Next in thread: Peter van Merkerk: "Re: beginner string question"
- Reply: Peter van Merkerk: "Re: beginner string question"
- Reply: Jon Bell: "Re: beginner string question"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|