getline help

How do you use
1
2
getline(cin, input);
cin.ignore();

without the double space.

also as a side note how do you prototype a function?
What double space?

Side Note:
1
2
3
4
5
6
7
8
9
10
11
int my_function(char c); // prototype

int main()
{
    int i = my_function('A');
}

int my_function(char c) // definition
{
    return int(c);
}

A prototype is simply the function description without the function body.
ok to prototype and i have had a linux os with gterminal and a mac w/ xcode and when ever i use above code it makes me hit enter twice instead of once on the program
Then remove the line cin.ignore();.
Topic archived. No new replies allowed.