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
#include <iostream.h>
void main
{
char thisisyourname[30];
cout << "What is your name?";
cin >> thisisanumber;
cout << endl << "Your name is " << thisisanumber;
}
if i've made an obvious mistakes it's cos i'm writing it from memory. (it did work)
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 i came up with
// #include <iostream.h>
void main()
{
char thisisyourname[30];
istream::write "what is your name?";
istream::getline (thisisyourname,30);
ostream::write "You are " && thisisyourname;
}
which has lots of errors like
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. why doesnt it work?
cheers
===============
Security Forums
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
#include <iostream.h>
void main
{
char thisisyourname[30];
cout << "What is your name?";
cin >> thisisanumber;
cout << endl << "Your name is " << thisisanumber;
}
if i've made an obvious mistakes it's cos i'm writing it from memory. (it did work)
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 i came up with
// #include <iostream.h>
void main()
{
char thisisyourname[30];
istream::write "what is your name?";
istream::getline (thisisyourname,30);
ostream::write "You are " && thisisyourname;
}
which has lots of errors like
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. why doesnt it work?
cheers
===============
Security Forums