Return to Snippet

Revision: 41635
at February 21, 2011 23:48 by marwac6


Initial Code
#include <iostream> int main() {
using namespace std; const int ArSize = 20; char name[ArSize]; char dessert[ArSize];
cout << “Enter your name:\n”; cin.getline(name, ArSize); // reads through newline cout << “Enter your favorite dessert:\n”; cin.getline(dessert, ArSize);
cout << “I have some delicious “ << dessert; cout << “ for you, “ << name << “.\n”; return 0;
}

Initial URL

                                

Initial Description

                                

Initial Title
Reading more than one word

Initial Tags
array

Initial Language
C++