Solved

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

Posted on 1997-07-08
5
218 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
[X]
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
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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

733 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