From the March 2016 Issue of Prestwood eMag |
| Standard C++: Using cin and cout | |
|
Posted 21 years ago on 3/18/2003 and updated 12/23/2008
Take Away: Using cin and cout in C++ to output values.
KB100152
|
Input and OutputExample 1: Using coutIn C++ the cout command (pronounced c out) allows you to output values. #include <iostream.h>; main() { cout << "Hello World!"; return 0; } Example 2: Using cin, cout, and declaring a char variable. #include <iostream.h>;
main() { char yourName[30]; cout << "What is your name? "; cin >> yourName; cout << "Hello " << yourName; return 0; }
0 Comments.
Share a thought or comment...
KB Article #100152 Counter |
14523 |
Since 4/2/2008
|
|