missing ; before {
Whats going on peoples. I suck so please help a fellow programmer out.
if (strcpy(Ohyeah.fienfive,"Stewart"))
{
cout<<"Stew: Hey "<
Built to resist the test of time
you must close every sentence that use character out that is 'cout' with ';', and you must use two '<<' and not one '<'.
for example...
cout << "C++ sux " << "big time!";
and not:
cout < "C++ rox " < "ahaa" //missing ;, and < must be <<
hope it helps, and get a girl
Edited by - ^cyer on May 19, 2001 12:58:16 PM
for example...
cout << "C++ sux " << "big time!";
and not:
cout < "C++ rox " < "ahaa" //missing ;, and < must be <<
hope it helps, and get a girl
Edited by - ^cyer on May 19, 2001 12:58:16 PM
May 19, 2001 12:20 PM
thomashun''s code got eaten because of HTML. You can see the full stuff by looking at the source, not quite as ridiculous as what is displayed here. The probably is that "else" requires an "if" to be used with a condition:
if (a_is_true())
do_a();
else if (b_is_true())
do_b();
else
do_something_else();
Also, since checking the result of strcpy (which copies strings) doesn''t quite make sense here, I''m going to guess that you really mean to compare strings, in which case strcmp is what you''re looking for. And remember, strcmp returns 0 if strings are equal so you need something such as: "if (0 == strcmp(a,b))"
I agree with the poster who recommends getting a book. There''s plenty of free stuff on the Internet that''ll get you started if you''re too cheap to buy a book.
if (a_is_true())
do_a();
else if (b_is_true())
do_b();
else
do_something_else();
Also, since checking the result of strcpy (which copies strings) doesn''t quite make sense here, I''m going to guess that you really mean to compare strings, in which case strcmp is what you''re looking for. And remember, strcmp returns 0 if strings are equal so you need something such as: "if (0 == strcmp(a,b))"
I agree with the poster who recommends getting a book. There''s plenty of free stuff on the Internet that''ll get you started if you''re too cheap to buy a book.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement