if (condition) statement1 else statement2
How do I say, if what the user typed in equals the string that I want it to equal then execute the function.
Thanks,
-Nos
This is a discussion on If then Else statement help within the C++ Programming forums, part of the General Programming Boards category; if (condition) statement1 else statement2 How do I say, if what the user typed in equals the string that I ...
if (condition) statement1 else statement2
How do I say, if what the user typed in equals the string that I want it to equal then execute the function.
Thanks,
-Nos
Use strcmp() to compare strings.
Code:char a[] = "nosfearatu" ; char b[] = "nesfearatu" ; if ( strcmp( a, b ) == 0) match_func() ; // true else nomatch_func() ;
Mac and Windows cross platform programmer. Ruby lover.
Quote of the Day
12/20: Mario F.:I never was, am not, and never will be, one to shut up in the face of something I think is fundamentally wrong.
Amen brother!
Thanks.