November 25th, 2003, 12:36 AM
simple little C++ program not working....
Ive been able to get this working in Windows, but once i go into Linux, it doesnt work =/.
cout << "Type your first and last name: ";
cin >> first_name >> last_name;
cout << "Hey, " << first_name << " " << last_name;
Thats what I have, straight out of the book, It works in windows, but when i do $gcc name name.cpp
it says this
In file included from /usr/include/g++/backward/iostream.h:31,
/usr/include/g++/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 184.108.40.206 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <sstream> instead of the deprecated header <strstream.h>. To disable this warning use -Wno-deprecated.
name.cpp:5: error: `main' must return `int'
And i saw the main must return int, so i did return 0; after my last cout statement, but it still did nothing, are there different ways to write C++ in windows/linux? What am i doing wrong?!? >.<
What do you get when you cross a nun and a penguin?
An operating system that won\'t go down on you.