Hi,
I'm trying to get into C++, but i tend to learn stuff better in my own strange way
[using vc++ 6]
i had a simple program that was like
if i've made an obvious mistakes it's cos i'm writing it from memory. (it did work)Code:#include <iostream.h> void main { char thisisyourname[30]; cout << "What is your name?"; cin >> thisisyourname; cout << endl << "Your name is " << thisisyourname; }
And then i wondered about iostream.h, couldnt I take some stuff out of there and write it in the program and do away with the #include
and after looking at webpages from http://www.cplusplus.com/ref/iostream/ i came up with
which has lots of errors likeCode:// #include <iostream.h> void main() { char thisisyourname[30]; istream::write "what is your name?"; istream::getline (thisisyourname,30); ostream::write "You are " && thisisyourname; }
istream' : is not a class or namespace name
and 'write' : undeclared identifier
in fact one set for every line.
i expect '&&' is wrong as well, i just guessed.
question is. can this work? differently?
cheers