answersLogoWhite

0


Best Answer

We don't have to do anything fancy to implement this, we can simply extract the character sequence directly into a standard string object. By default, all leading whitespace characters (space, tab and newline) are ignored and extraction ends when the next whitespace or newline character is encountered in the character sequence.

#include<iostream>

#include<string>

int main () {

std::string s {};

std::cout << "Enter some text:\n";

std::cin >> s;

std::cout << "The first word input was:\n";

std::cout << s << std::endl;

}

Output:

Enter some text:

one two three

The first word input was:

one

User Avatar

Wiki User

8y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

6y ago

In C++, std::cin is an abstract object representing the global standard console input stream device, synonymous with stdin in C.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is cin in c plus plus programming language?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Who is the owner of c plus plus language?

Bjarne Stroustrup is the author of C++. However, no one "owns" this language.


Why c in and c out used in c?

In the programming language C++, cin is used to input the variable and cout is used to print a certain message or result.


What is the significance of c plus plus?

C++ is an object oriented programming language


What is the use of c plus plus in banks?

Programming language.


Differentiate C plus plus and Turbo C?

Turbo C is a software where C or C++ programming environment resides in.But C++ is itself a programming language.


Who is founder of C plus plus programming language?

Bjorn Stroustrup


Is c plus plus an unstructured programming language?

No, BASIC is, for example.


Is score a reserved word in the C plus plus programming language?

No.


Who designed the C plus plus programming language?

Bjarne Stroustrup


What is programming languages in c plus plus?

Programming in C++ means designing and writing a computer program using the C++ programming language. C++ is a high-level, machine-independent language which must be converted into machine-dependent code by a compiler.


What is structured programming language in C plus plus?

Your question makes no sense.


Who designed and implemented the c plus plus programming language?

Bjarne Stroustroup