| marius19 (4) | |
|
#include <iostream> #include <string> using namespace std; int main() { string FirstName, MiddleName, LastName, fullName; cout << "PLease enter your FullName:" << endl; getline (cin, fullName); FirstName = FirstName.substr(1, FirstName.length()); MiddleName = MiddleName.substr(1, MiddleName.length()); LastName = LastName.substr(1, LastName.length()) cout << "First Name: " << FirstName << endl; cout << "Middle Name: " << MiddleName << endl; cout << "Last Name: " << LastName << endl; return 0; } i`m getting a c2146 full name.cpp(12): error C2146: syntax error : missing ';' before identifier 'cout'.can someone please help me iy`s urgent!!! thanks | |
|
|
|
| firedraco (5414) | |
|
You are missing a ';' somewhere before that cout. Also, wrong section. | |
|
|
|
| Zhuge (2871) | |
| What is this doing in Articles? Please move it to beginners. And you are missing a semicolon after your assignment to LastName. | |
|
|
|
| marius19 (4) | |
|
ok thanks,got,i`m new to the site so i`m still a bit new to this but thanks for quick reply!! | |
|
|
|
| marius19 (4) | |
| sori,but it gives me a debug error? anyone know how i can fix it? the sooner o can fix it the sooner i can erase the post. | |
|
|
|
| firedraco (5414) | |
| You seem to have an error with your design. Look up substr() again, because as is, your code won't get you the names. | |
|
|
|
| marius19 (4) | |
| ok,thanks for the help. | |
|
|
|