We help IT Professionals succeed at work.

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

kellyjj
kellyjj asked
on
Medium Priority
299 Views
Last Modified: 2010-04-10
I need to know what does  ' cout <<  << ' do?  
I am using it to print a linked list.  
Comment
Watch Question

Commented:
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!
Commented:
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

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
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.

Commented:
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?

Commented:
are you still having a problem with this one??
all of these answers seem correct??

bradz
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.