Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 10-01-2011
Member
 
Join Date: Jan 2011
Posts: 33
What is the difference between cin and cout in C++

Hey Guys, I wanted to know about the difference between cin and cout. I am not able to understand which input operator is and which the output operator is. Is there any operator symbol used in cin and cout? If anyone having knowledge or information then please let me know as soon as possible. If anyone having any related information then please let me know.
Reply With Quote
  #2  
Old 10-01-2011
Member
 
Join Date: May 2009
Posts: 532
Re: What is the difference between cin and cout in C++

C++ performs the input and output operation by mean of cin and cout. These are the two objects of the predefined classes which are in header file iostream.h. So to perform the input output operation one has to include the iostream h header file in the program. cin uses the input operator << where as cout uses the output operator >>. Cin is an object which receives input from the keyboard and stores the input given by the user in the variable defined by user. Whereas cout it retrieves the value of the variable and display it on screen.
Reply With Quote
  #3  
Old 10-01-2011
Member
 
Join Date: May 2009
Posts: 523
Re: What is the difference between cin and cout in C++

Cin and Cout are the two streams.
The general syntax for cin is as.

cin>> var1>>var2?.;

The cin statement accepts the input from the user and stores it in a variable which is on the right hand side.

The general syntax for cout is as.
cout<< var1<<var2?.;

The cout statement retrieves data from the variable which is on the right hand side and displays it on the screen.
Reply With Quote
  #4  
Old 10-01-2011
Member
 
Join Date: May 2009
Posts: 620
Re: What is the difference between cin and cout in C++

You must know that when you have to print any statement in C++ then you have to use cout operator in C++. Cin is used as input operator in C++ where it will read the variable and then it stores the input which is been sent by the user from the keyboard. You can assume cin as input given by the user where as the cout is the input given by the user to display it in output.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "What is the difference between cin and cout in C++"
Thread Thread Starter Forum Replies Last Post
How can I print any number or character using cout in C++ UseME Software Development 5 26-02-2010 10:17 PM
Difference between jsp and asp.net Crespin Software Development 3 24-11-2009 06:57 AM
What is the difference between JSP and PHP? Volodymyra Software Development 3 20-04-2009 10:23 PM
What is the Difference between Blu-ray and HD-DVD? Maryna Hardware Peripherals 3 06-01-2009 01:43 PM
Difference between VB and VB.net Braze Software Development 3 05-01-2009 10:19 PM


All times are GMT +5.5. The time now is 06:47 PM.