tags:

views:

94

answers:

3

How to take input values in C++, in how many ways we can take input values.? Please describe in brief with small examples

+2  A: 

For a command line application, I think the best way is to use the command line arguments. For an GUI application build using some libarary you can always have forms. And the bad way would be to ask questions to user once the application start!

Abdel Olakara
@Abdel: "And the bad way would be to ask questions to user once the application start!" So, when is the right moment to ask for user input, after program termination? Or do you mean posing questions via speech synthesis in a monotone, robotic voice? Please clarify!
Greg S
@Greg what i was referring to was use of text questions. For example, you run a application named 'add' and press enter.. Its asks you "Enter first number:" then "Enter second number" etc.. that is really bad way!!!
Abdel Olakara
A: 

Cin >> likethis; :P

(Sorry.Couldn't control)

Ravi
A: 

For console application you have two standard ways:

  1. Argument values.
  2. User input.
Andrejs Cainikovs