Newb Question
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 17

Thread: Newb Question

  1. #1
    Join Date
    Jan 2009
    Posts
    7

    Newb Question

    Alright. So I literally just started learning C++ from a tut I found and I ran into a problem.



    #include <iostream.h>
    int main()
    {
    cout<< " What you do is what you get";
    }



    This page: http://www.planet-source-code.com/vb...d=769&lngWId=3

    has said tut on it.



    This:

    1. #include <iostream.h>
    2. int main()
    3. {
    4. cout<< “ What you do is what you get”;
    5. }

    is what I was supposed to type out(without the letters). The only issue I see is that the first quotation mark look different than the last. However, I cannot find this specific symbol on my keyboard. I am in need of assistance.
    Reader warning: This user will probably insult your mother and how she's so fat.

  2. #2
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,206

    Re: Newb Question

    Use the double quote for both of them.

  3. #3
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Fairfax, VA
    Posts
    10,891

    Re: Newb Question

    That tutorial is out of date. You should be using <iostream>, not <iostream.h> anymore.

  4. #4
    Join Date
    Jan 2009
    Posts
    7

    Re: Newb Question

    That's just it. From what I understand that is the key I used. Please do not mistake me for some moron who's never used a computer in his life. If this is, in fact, a learning environment then noob bashing would hardly be good for this forum's image. Not that I am accusing you of doing so.

    Quote Originally Posted by Lindley View Post
    That tutorial is out of date. You should be using <iostream>, not <iostream.h> anymore.
    Thank you. However my original issue is still unresolved. I am receiving this error:

    `cout' undeclared (first use this function)
    Reader warning: This user will probably insult your mother and how she's so fat.

  5. #5
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,206

    Re: Newb Question

    Quote Originally Posted by Syko View Post
    Thank you. However my original issue is still unresolved. I am receiving this error:

    `cout' undeclared (first use this function)
    That wasn't your original issue. I told you what to do with that.

  6. #6
    Join Date
    Jan 2009
    Posts
    7

    Re: Newb Question

    And I explained my predicament. I did, in fact, use the double quote key from what I understand. What I am asking of you is to provide proof opposing that the key I used was the correct one.
    Reader warning: This user will probably insult your mother and how she's so fat.

  7. #7
    Join Date
    Oct 2002
    Location
    Austria
    Posts
    1,284

    Re: Newb Question

    Quote Originally Posted by Syko View Post
    And I explained my predicament. I did, in fact, use the double quote key from what I understand. What I am asking of you is to provide proof opposing that the key I used was the correct one.
    Could it be that you're using the right key but the wrong editor ?
    Kurt

  8. #8
    Join Date
    Jan 2009
    Posts
    7

    Re: Newb Question

    Ah. That may be it. The editor that I am using was downloaded from a link on the same site as the tut I used. I will find another more up to date editor and try this out once more.
    Reader warning: This user will probably insult your mother and how she's so fat.

  9. #9
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,206

    Re: Newb Question

    Quote Originally Posted by Syko View Post
    And I explained my predicament. I did, in fact, use the double quote key from what I understand. What I am asking of you is to provide proof opposing that the key I used was the correct one.
    My keyboard only has one double quote key. It's the same double quote on both sides of the string. Other than telling you that's the way it works, there's no proof I can offer.

  10. #10
    Join Date
    Jan 2009
    Posts
    7

    Re: Newb Question

    I understand. I am still in the process if searching for a decent editor. I'm sure that was the problem. The tutorial itself was outdated which would mean the links in said tut would likely be outdated as well.
    Reader warning: This user will probably insult your mother and how she's so fat.

  11. #11
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Fairfax, VA
    Posts
    10,891

    Re: Newb Question

    Any old editor will work so long as it doesn't try to "pretty-print" the quotes. You can use Notepad on Windows, emacs on Linux, whatever.

  12. #12
    Join Date
    Jan 2009
    Posts
    7

    Re: Newb Question

    How would I go about compiling and running if I used Notepad?
    Reader warning: This user will probably insult your mother and how she's so fat.

  13. #13
    Lindley is offline Elite Member Power Poster
    Join Date
    Oct 2007
    Location
    Fairfax, VA
    Posts
    10,891

    Re: Newb Question

    You could use a command-line compiler, naturally. That's not the best choice on Windows though. Just get Visual Studio Express 2008 there, I'd say.

  14. #14
    Join Date
    Mar 2002
    Location
    NY, USA
    Posts
    12,097

    Re: Newb Question

    Quote Originally Posted by Lindley View Post
    You could use a command-line compiler, naturally. That's not the best choice on Windows though. Just get Visual Studio Express 2008 there, I'd say.
    Or use a hex disk editor and mentally compile the source to the appropriate op-codes and operands (don't forget the PE header!]

    For 90% of all situations, there is simply no good practical reason NOT to use a modern IDE. Remember to learn the editor,compiler, and debugger incrementally as you proceed on your path towards knowledge.
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009
    In theory, there is no difference between theory and paractice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

  15. #15
    Join Date
    Jan 2009
    Posts
    7

    Re: Newb Question

    Thank you. Your help is much appreciated.
    Reader warning: This user will probably insult your mother and how she's so fat.

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center