hello everyone, im very new to CPP.
i have been trying to make a simple I/O code that asks basic questions.
this will not run . i get error messages when running this on CPP droid app at work. anything you guys would change to make this run better? should i use string instead of char? .
again im really new this so sorry for the elementary questions.
#include <iostream>
#include <cstdlib>
usingnamespace std;
int main()
{
char name [13];
cout<<"welcome, what is your name?" << endl;
cin>> name >> endl;
cout<<"hello"<<name<< endl;
return 0:
}
#include <iostream>
#include <cstdlib>
usingnamespace std;
int main()
{
char name[13];
cout << "welcome, what is your name?" << endl;
cin >> name;
cout<< "hello " << name << endl;
return 0;
}
There were some syntax errors. Here in statement return 0: a colon was used instead of a semicolon and you can not use endl with cin cin>> name >> endl;
I would recommend you following a good book and practicing at the same time.