"hello! world" gives error

This is a discussion on "hello! world" gives error within the C++ Programming forums, part of the General Programming Boards category; That is my bad, I was just trying to help. I am using Visual C++ 6.0...I take it I need ...

  1. #16
    Registered User
    Join Date
    Jun 2003
    Posts
    73
    That is my bad, I was just trying to help. I am using Visual C++ 6.0...I take it I need a better version then? Also it wont let me pass the exe file to someone to view it because its a standard version..what version do I need to be able to give an exe file to someone to make it run.

  2. #17
    Cat
    Cat is offline
    Registered User
    Join Date
    May 2003
    Posts
    1,571
    You should be able to give an .EXE to someone, although you may need to bundle .DLLs with it, depending on your compiler settings.

    And yes, VC6 is not standard conforming. My "Hello World" program wouldn't compile on it; VC6 is older than the standard. The next version, Visual Studio .NET 2002, would compile both of our programs, although it would give a warning on yours. The newest version, Visual Studio .NET 2003, wouldn't compile your program at all.

  3. #18
    Registered User
    Join Date
    Jun 2003
    Posts
    73
    so if I get VS2003 I would be able to send my exe file to someone..that is what I want. I am in Intro to Programming right now and my first assignment was Hello World:-) It worked on V6.0, thats why I thought I would try to help. But thank you for the advice, I like this board cause I actually learn alot.

  4. #19
    Registered User HaLCy0n's Avatar
    Join Date
    Mar 2003
    Posts
    77
    Technically, by following the standard, the return 0 at the end of your program is redundant, since the standard states:
    A return statement in main has the effect of leaving the main function (destroying any objects with automatic storage duration) and calling exit with the return value as the argument. If control reaches the end of main without encountering a return statement, the effect is that of executing

    return 0;
    Just thought that was interesting

  5. #20
    Cat
    Cat is offline
    Registered User
    Join Date
    May 2003
    Posts
    1,571
    Originally posted by romeoz
    so if I get VS2003 I would be able to send my exe file to someone..that is what I want. I am in Intro to Programming right now and my first assignment was Hello World:-) It worked on V6.0, thats why I thought I would try to help. But thank you for the advice, I like this board cause I actually learn alot.
    You should (with a few exceptions) be able to send ANY executable, from any compiler, and it should work.

    If you made an .EXE in VS6 and it won't run on another computer, the program probably needs VC6 DLLs, which they can download. Having VS2003 wouldn't make a difference, you still need to either statically link all libraries, or give them DLLS.

    I do like VS2003, though, because it conforms very well to standards. If you can get it at a decent price, I recommend it highly. It's not perfect, but I've never seen the perfect compiler yet.

    BTW, if you can get a legal full copy of .NET Professional 2002 (sometimes just called .NET Professional), until august you can get an upgrade to .NET Professional 2003 for $30. Might be cheaper that way, if you can snag a legal used copy.
    Last edited by Cat; 06-12-2003 at 03:24 PM.

  6. #21
    Registered User
    Join Date
    Jun 2003
    Posts
    73
    After I write my program I compile it then I go to Execute program and this little box pops up. Note: The terms of End User License Agreement for Visual C++ Introductory Edition do not permit redistribution of executables you create with this product.

    How can I get arond this? Get a new serial number or something to register it with?

    Bryan

  7. #22
    Cat
    Cat is offline
    Registered User
    Join Date
    May 2003
    Posts
    1,571
    Ahhh, no, in that case, you can't.

    Problem is you have an academic version, you need a professional version; it's not legal to distribute programs made with the academic.

  8. #23
    Registered User
    Join Date
    Jun 2003
    Posts
    73
    I just installed C++ Enterprise...now I can create the exe file without that error...but I want to run it as the exe standalone while I exit out of C++...when I click on the exe file and since C++ is closed it just opens a black box for a second and shuts down. I cant run the exe file..why is this happening?

    Bryan

  9. #24
    C++ Developer XSquared's Avatar
    Join Date
    Jun 2002
    Location
    Ontario, Canada
    Posts
    2,718
    Naturally I didn't feel inspired enough to read all the links for you, since I already slaved away for long hours under a blistering sun pressing the search button after typing four whole words! - Quzah

    You. Fetch me my copy of the Wall Street Journal. You two, fight to the death - Stewie

  10. #25
    Registered User
    Join Date
    Jun 2003
    Posts
    1
    if you inlcude conio.h you could use the getch() command, wich waits for a input from the keyboard. then it it wouldn't close before you press a key.

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

Similar Threads

  1. Testing some code, lots of errors...
    By Sparrowhawk in forum C Programming
    Replies: 48
    Last Post: 12-15-2008, 03:09 AM
  2. Another syntax error
    By caldeira in forum C Programming
    Replies: 31
    Last Post: 09-05-2008, 01:01 AM
  3. Making C DLL using MSVC++ 2005
    By chico1st in forum C Programming
    Replies: 26
    Last Post: 05-28-2008, 01:17 PM
  4. Learning OpenGL
    By HQSneaker in forum C++ Programming
    Replies: 7
    Last Post: 08-06-2004, 08:57 AM
  5. Couple C questions :)
    By Divx in forum C Programming
    Replies: 5
    Last Post: 01-28-2003, 12:10 AM

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