VOOZH about

URL: https://www.geeksforgeeks.org/cpp/basic_istreamoperator-in-c/

⇱ basic_istream::operator>> in C++ - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

basic_istream::operator>> in C++

Last Updated : 15 Jul, 2025

The basic_istream::operator>> is known as the extraction operator. This operator is used to apply on the input string. 
Header File: 
 

<iostream>


Syntax: 
 

basic_istream& operator>>( int& a );
basic_istream& operator>>( unsigned int& a );


Parameters: 
 

  • a : This represents the value where the extracted character are stored.


Return Value: The istream::operator>> returns the basic_istream object.
Below is the program to illustrate std::basic_istream::operator>>:
Program 1: 
 


Output: 
a = 12
b = 12.2
c = false

 

Program 2: 
 


Output: 
a = 144
b = 0.26
c = false

 

Reference: https://cplusplus.com/reference/istream/basic_istream/operator%3E%3E/
 

Comment
Article Tags: