Solved

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

Posted on 1997-07-08
5
211 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

746 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now