Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

what does ' cout <<   << ' do??

Posted on 1997-07-08
5
217 Views
Last Modified: 2010-04-10
I need to know what does  ' cout <<  << ' do?  
I am using it to print a linked list.  
0
Comment
Question by:kellyjj
5 Comments
 
LVL 1

Expert Comment

by:byoung
ID: 1164486
cout << "Variable foobar = " << foobar << endl;
say foobar = 5, then on the screen it would print out:
Variable foobar = 5
if you're using it to print a linked list to the screen, put a loop(for or while or the like) around the cout command and increment which part of the linked list you print each time thorugh the outer loop.  Therefore producing a printout of your linked list.  Good Luck!
0
 

Accepted Solution

by:
bradz earned 10 total points
ID: 1164487
The cout comand returns itself! if that makes it clear!?!?

So << << shouldn't do anything -> may be syntax error

If you want to print a list you should overload the cout << operator.

want the code??

bradz

0
 
LVL 2

Author Comment

by:kellyjj
ID: 1164488
bradz,  e mail me.  kellyj@r2d2.bpginc.com.  I don't what you mean, "cout returns itself".  do you mean it is recursive.?

and thanks for the linked list answer.  A head node, after all that I have done and I did not think of that,   boy I am a homer.
0
 

Expert Comment

by:cbcb
ID: 1164489
I'm new to this forum, but I was jsut wondering what was wrong with the first answer?  If it's wrong, I shouldn't be expert status because it seems totally correct to me.  I'm I wrong?
0
 

Expert Comment

by:bradz
ID: 1164490
are you still having a problem with this one??
all of these answers seem correct??

bradz
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
C language IDE ā€“ Compilers installation 14 75
Error C2678: binary '!=': no operator found... 4 59
No module found pypyodbc, 3 33
Gaming Software 1 19
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [sā€¦
  Included as part of the C++ Standard Template Library (STL) is a collection of generic containers. Each of these containers serves a different purpose and has different pros and cons. It is often difficult to decide which container to use and ā€¦
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question