Free compile...

Discussion in 'Game Modifications' started by Firkat54, Sep 29, 2005.

  1. Firkat54

    Firkat54 Newbie

    Joined:
    Mar 19, 2005
    Messages:
    236
    Likes Received:
    0
    Since no one seems to be active on the General Editing forum, I thought I'd ask here.



    Sorry bout the spam, but no one has responded to the other post, and I figure this would have been the better place to post in the first place.
     
  2. crackhead

    crackhead Newbie

    Joined:
    Nov 25, 2004
    Messages:
    2,158
    Likes Received:
    0
    umm unless your really experienced you need to buy the visual studio 2003. but its only like 80 quid.
     
  3. goalied00d

    goalied00d Guest

    code::blocks
     
  4. Angry Lawyer

    Angry Lawyer Newbie

    Joined:
    May 31, 2004
    Messages:
    6,873
    Likes Received:
    0
    What error message does it throw up? You might have made your function a void or a bool, or something, in which you need to either return NULL, or return a value that matches the function type.

    -Angry Lawyer
     
  5. Firkat54

    Firkat54 Newbie

    Joined:
    Mar 19, 2005
    Messages:
    236
    Likes Received:
    0
    No error, it just imediately closes the program. When I first started learning, the "Hello World" program worked flawlessly, but now it just closes before you can see the output.

    The code used before and after:
    Code:
    #include <iostream.h>
    
    int main ()
    {
      cout << "Hello World!";
      return 0;
    }
    
    I've tried using this as well.. It does work, but I'm guessing it won't work later:
    Code:
    #include <iostream.h>
    
    int main ()
    {
      cout << "Hello World!";
      cin.get()
      return 0;
    }
    
    It also seems to dislike 'double' variables.

    If you guys could help me fix it that would be great as well. Also, just so you know, I'm not planning on modding source, I'm learning just because I love coding, and this is the only place I could think of that people wouldn't be completely moronic about new cpp programmers.
     
  6. goalied00d

    goalied00d Guest

    You're program runs fine, it's just that it runs so fast and return 0; means it runs succesfully then exits immediately.

    What you can do to keep it open is to execute it from the command line

    There are a few othwr ways to keep it open like using cin.get() function or system "PAUSE" you'll have to check your c++ references on proper usage of those.
     
  7. Pesmerga

    Pesmerga Newbie

    Joined:
    Dec 31, 2004
    Messages:
    10,094
    Likes Received:
    1
    add

    Code:
    cout << lawl;
    at the end of your program.

    and you'll see the entire thing :p
     
  8. Firkat54

    Firkat54 Newbie

    Joined:
    Mar 19, 2005
    Messages:
    236
    Likes Received:
    0
    Ok, thanks, but then can someone explain why it paused before? Or is it just some freak mistake? And also, why would they put that in so many tutorials, if it doesn't work properly(maybe I phrased that wrong, if it doesn't work like they say it should)?
     
  9. Angry Lawyer

    Angry Lawyer Newbie

    Joined:
    May 31, 2004
    Messages:
    6,873
    Likes Received:
    0
    You probably accidentally changed an option on your computer to close DOS programs automatically when they've finished running.
    Nothings wrong with your code, or your compiler.

    -Angry Lawyer
     
  10. Firkat54

    Firkat54 Newbie

    Joined:
    Mar 19, 2005
    Messages:
    236
    Likes Received:
    0
    Awesome. Thanks a lot guys. You've helped a ton :)
     

Share This Page