bug-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

String: can someone explain this...


From: Albert Schueller
Subject: String: can someone explain this...
Date: Mon, 16 Oct 2000 13:51:11 -0000
User-agent: slrn/0.9.5.7 (UNIX)

Hi,

Why do the two couts in this snippet of code printout different things when
response = "no"; but the same thing when response = "yes";?

I'm using egcs-2.91.66 on a Redhat 6.1-i386 machine.

thanks,

Albert

///////////////////////////////////////////////////////////////////////////

#include <iostream>
#include <string>

int main() {
  string response("no");
  int position;

  cout << response.find_first_of("yY") << endl;
  position  = response.find_first_of("yY");
  cout << position << endl;

  return 0;
}



-- 
Albert Schueller                                 Department of Mathematics
Office Phone:  509-527-5140                      Whitman College
Public Key:  http://carrot.whitman.edu/gpg.key   Walla Walla, WA USA 99362



reply via email to

[Prev in Thread] Current Thread [Next in Thread]