C
crea
Simple question. If the task is (for example):
"Write a C++ program which asks user his name (less than 20 chars) and
prints it."
Then, is this code a correct answer:
char name[100];
cout<<"Your name?"<<endl;
cin>>name;
cout<<name<<endl;
The point being, that the code uses C string "char name[]" and not C++
std::string.
C is a subset of C++, so isnt it logically speaking a C++ program?
"Write a C++ program which asks user his name (less than 20 chars) and
prints it."
Then, is this code a correct answer:
char name[100];
cout<<"Your name?"<<endl;
cin>>name;
cout<<name<<endl;
The point being, that the code uses C string "char name[]" and not C++
std::string.
C is a subset of C++, so isnt it logically speaking a C++ program?