hey please can anybody guide me how we can take input from the command prompt as we do in C++ and Java. I can take input using .dat files but I want the user to give input in the command prompt.
I will be very thankful.

Recommended Answers

All 2 Replies

You should look into ifstream and cin and the >> operator.

You should look into ifstream and cin and the >> operator.

cin is console input & cout is console output. David is right on spot. You can also use cin.getline().

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.