Can I not reference another class within a class?

This is a discussion on Can I not reference another class within a class? within the C++ Programming forums, part of the General Programming Boards category; You can't use functions with a void return type with cout. You need to actually return something for it to ...

  1. #16
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,301
    You can't use functions with a void return type with cout. You need to actually return something for it to output.
    It looks like std::string would be the intended return type.
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

  2. #17
    Registered User
    Join Date
    Dec 2007
    Location
    Rochester
    Posts
    40
    Do I have to use typecasting to get a number displayed onto a string?

    Or is there a better method?

  3. #18
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,484
    Quote Originally Posted by cpudaman View Post
    Do I have to use typecasting to get a number displayed onto a string?

    Or is there a better method?
    stringstream?
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 4
    Last Post: 05-13-2011, 08:28 AM
  2. Textbox
    By maxorator in forum Windows Programming
    Replies: 20
    Last Post: 09-25-2005, 10:04 AM
  3. How to: Use OpenGL with Jgrasp
    By Pickels in forum Game Programming
    Replies: 3
    Last Post: 08-30-2005, 10:37 AM
  4. Replies: 10
    Last Post: 06-05-2004, 07:40 PM
  5. structure vs class
    By sana in forum C++ Programming
    Replies: 13
    Last Post: 12-02-2002, 06:18 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21