quicky

This is a discussion on quicky within the C++ Programming forums, part of the General Programming Boards category; quick question: im planning on taking computer science next year, but i have a question for now. why is the ...

  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    26

    quicky

    quick question:

    im planning on taking computer science next year, but i have a question for now.

    why is the output only "hello world" and doesnt include the rest in the quotes.

    Code:
    #include <iostream.h>
    
    int main()
    
    {
    
      cout<<"HEY, you, I'm alive!  Oh, and Hello World!";
    
      return 0;    
    
    }

  2. #2
    RoD
    RoD is offline
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    uhh not sure what u mean, i get

    HEY, you, I'm alive! Oh, and Hello World!Press any key to continue
    which is 100% correct. Mind if i improve upon the code some?

    Code:
    #include <iostream>
    
    using namespace std;
    
    int main()
    
    {
    
      cout<<"HEY, you, I'm alive!  Oh, and Hello World!" 
             <<endl;
    
      return 0;    
    
    }

  3. #3
    Registered User
    Join Date
    Nov 2002
    Posts
    1,109
    the "'s are not output because that signifies to the compiler that this is a literal string that you want output, in this case Hello, world! It is part of the syntax of c/c++. I hope this is what you mean.

  4. #4
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398
    It looks like there is an error in your text book!

  5. #5
    RoD
    RoD is offline
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    Originally posted by DougDbug
    It looks like there is an error in your text book!
    I took ti as he isnt learning with a book. I think he didnt see the rest of it, or like was previously said expected the "" to output.

  6. #6
    Registered User
    Join Date
    Nov 2002
    Posts
    1,109
    nevermind, you could disregard my above post. read the original ? too fast.

    did you write "Hello World" before this, and then modified it to say this, and not save and recompile?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Need a quicky C reference guide of come sort
    By iecki in forum C Programming
    Replies: 2
    Last Post: 01-17-2008, 06:42 PM
  2. Quicky Question
    By Krak in forum C++ Programming
    Replies: 8
    Last Post: 02-06-2005, 05:45 AM
  3. stderr quicky question - I GOT IT thank you so much
    By HOWY in forum Linux Programming
    Replies: 0
    Last Post: 07-05-2002, 11:28 AM
  4. stderr quicky question
    By HOWY in forum Linux Programming
    Replies: 1
    Last Post: 07-05-2002, 10:52 AM
  5. quicky
    By Showster in forum C Programming
    Replies: 2
    Last Post: 11-30-2001, 12:42 PM

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