Thread: Returning an integer ... not returning; weird error

  1. #16
    Registered User
    Join Date
    May 2010
    Posts
    178
    I picked up copies of C++ Primer and Accelerated C++. Both books have had some interesting reviews on Amazon although C++Primer has many bad reviews but it is the book I am using now. I am not sure of of the authors use of

    Code:
    std::cout * "TextTextTextTextTextTextText" * std::endl;
    I could not find the operator '*' for iostream anywhere and I only know "get from" >> and "put to" <<

    I will state the recommended books on this forum are there for a reason and I endorse many as an owner. I hate the C->C++.Learning_Approach and in C++Primer I am already covering vectors which would not be touched on until like chapter 12 in Prata's C++ Primer Plus ... I am happy now and seem less like a bafoon.

    ** C++Primer gets into classes by chapter two ... amazing. I am still out on a which is best if coming from Java and C to C++ but looks good.

    I do owe you an apology AndrewHunter because you were right in your insistence that if I program in C++ I should program C++. Thank you.
    Last edited by Imanuel; 09-25-2011 at 01:02 PM.

  2. #17
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    There is no overloaded operator * for std::cout, since it would not make any sense.
    (How do you multiply a stream and a string?)
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  3. #18
    Registered User
    Join Date
    May 2010
    Posts
    178
    Quote Originally Posted by Elysia View Post
    There is no overloaded operator * for std::cout, since it would not make any sense.
    (How do you multiply a stream and a string?)
    I agree but the author in C++Primer uses '*' for std::cout * with no explanation further or pending.

  4. #19
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    The book seems to have had additional bad feedback:
    ACCU :: Book Reviews Search

    I recommend you get rid of that book.
    I cannot understand what the author is trying to convey, and that seems to be a general statement about the book.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  5. #20
    Registered User
    Join Date
    May 2010
    Posts
    178
    Quote Originally Posted by Elysia View Post
    The book seems to have had additional bad feedback:
    ACCU :: Book Reviews Search

    I recommend you get rid of that book.
    I cannot understand what the author is trying to convey, and that seems to be a general statement about the book.
    Thank you for noting that. I bookmarked the site and , although I have sen that review before, I did not take it as seriously until I realized how bad Prata's book really is ... quite frankly terrible and will be donated to my university library .. or maybe not since it is worthy of the trash.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. physics class returning weird numbers
    By avgprogamerjoe in forum C++ Programming
    Replies: 1
    Last Post: 09-17-2007, 08:13 PM
  2. Recursion: base case returning 1, function returning 0
    By yougene in forum C Programming
    Replies: 5
    Last Post: 09-07-2007, 05:38 PM
  3. returning error on if/else in function
    By xion in forum C++ Programming
    Replies: 6
    Last Post: 06-12-2004, 03:45 AM
  4. error when returning template type~
    By black in forum C++ Programming
    Replies: 5
    Last Post: 06-01-2004, 01:33 AM
  5. kernel keeps returning a clos() error
    By Chronom1 in forum Linux Programming
    Replies: 2
    Last Post: 03-30-2004, 06:21 PM