H
HED
Ok still a student who is basically teaching himself.... I am haveing
some touble getting how functions work, but I have figured SOME of it
out. (about 1/10 of 1%) My program has this function in it, and
after it is compiling it is telling me "c:\documents and settings\us
\my documents\visual studio 2005\projects
\assingment1\assingment1\assingment4a.cpp(45) : error C3861:
'getline': identifier not found"
huh? I have used getline before in the same format (I even checked
previous assingments), but I do not understand why it is doing that.
string getname()
{
string username;
cout<<"Please enter your name"<<endl;
getline (cin, username);
return username;
}
My other problem is " error C2448: 'menu' : function-style initializer
appears to be a function definition"
I thought i spoke pretty fluent geek until i started trying to debug
my programs.....
I do not understand what it is telling me. Menu is a void function,
but I am (I think/hope) trying to put a string in it, so it looks
like:
void menu(name)
{
cout<<"Welcome, "<<name<<", where would you like to go?"<<endl;
cout<<"Please select a destination:"<<endl;
cout<<"A. Natural History Museum"<<endl;
cout<<"B. French Bistro"<<endl;
cout<<"C. Art Gallerey"<<endl;
cout<<"D. Bookshop"<<endl;
cout<<"E. Concert"<<endl;
}
Earlier I was trying to get the places to be arguments, but that was
not working. I think I partially understand how to do that now. i.e.
instead of
cout<<"A. Natural History Museum"<<endl;
it will read
cout<<"A. "<<placea<<endl;
Sorry, my questions are:
1. why doesnt getline work, and how can I make it work
and
2. what does "function-style initializer appears to be a function
definition" mean?
Again, thanks in advance.
some touble getting how functions work, but I have figured SOME of it
out. (about 1/10 of 1%) My program has this function in it, and
after it is compiling it is telling me "c:\documents and settings\us
\my documents\visual studio 2005\projects
\assingment1\assingment1\assingment4a.cpp(45) : error C3861:
'getline': identifier not found"
huh? I have used getline before in the same format (I even checked
previous assingments), but I do not understand why it is doing that.
string getname()
{
string username;
cout<<"Please enter your name"<<endl;
getline (cin, username);
return username;
}
My other problem is " error C2448: 'menu' : function-style initializer
appears to be a function definition"
I thought i spoke pretty fluent geek until i started trying to debug
my programs.....
I do not understand what it is telling me. Menu is a void function,
but I am (I think/hope) trying to put a string in it, so it looks
like:
void menu(name)
{
cout<<"Welcome, "<<name<<", where would you like to go?"<<endl;
cout<<"Please select a destination:"<<endl;
cout<<"A. Natural History Museum"<<endl;
cout<<"B. French Bistro"<<endl;
cout<<"C. Art Gallerey"<<endl;
cout<<"D. Bookshop"<<endl;
cout<<"E. Concert"<<endl;
}
Earlier I was trying to get the places to be arguments, but that was
not working. I think I partially understand how to do that now. i.e.
instead of
cout<<"A. Natural History Museum"<<endl;
it will read
cout<<"A. "<<placea<<endl;
Sorry, my questions are:
1. why doesnt getline work, and how can I make it work
and
2. what does "function-style initializer appears to be a function
definition" mean?
Again, thanks in advance.