• Lucid Dreaming - Dream Views




    Results 1 to 25 of 165

    Hybrid View

    1. #1
      Ex Tech Admin Achievements:
      Created Dream Journal Tagger First Class Veteran First Class 10000 Hall Points Populated Wall Referrer Gold Made lots of Friends on DV
      slash112's Avatar
      Join Date
      Nov 2008
      Gender
      Location
      Sunny Scotland
      Posts
      5,113
      Likes
      1567
      DJ Entries
      29
      Oohhhhhhhh... Thanks.

      system("PAUSE") means that when I run the program, it doesn't close as soon as it finishes. But it lets you close it by pressing any key.
      Within the programing software stuff it isn't an issue, but when it is the .exe on it's own, when you run it, it would close the moment you finish inputing stuff.

    2. #2
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      Code::Blocks automatically pauses the execution at the end for you, you don't need that unless compiling or running outside of the IDE

    3. #3
      Gentlemen. Ladies. slayer's Avatar
      Join Date
      Mar 2007
      Gender
      Location
      Right here... Reputation: 9999
      Posts
      4,902
      Likes
      473
      DJ Entries
      4
      How to I package together my code into an exe or something both windows and macs can open?

    4. #4
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      Quote Originally Posted by slayer View Post
      How to I package together my code into an exe or something both windows and macs can open?
      A dos console and unix consoles are completely different. Macs can run windows console programs, you need to compile seperately for mac and windows

    5. #5
      Gentlemen. Ladies. slayer's Avatar
      Join Date
      Mar 2007
      Gender
      Location
      Right here... Reputation: 9999
      Posts
      4,902
      Likes
      473
      DJ Entries
      4
      Quote Originally Posted by ninja9578 View Post
      A dos console and unix consoles are completely different. Macs can run windows console programs, you need to compile seperately for mac and windows
      Then how do I do it just for windows?

    6. #6
      Banned
      Join Date
      Apr 2007
      Location
      Out Chasing Rabbits
      Posts
      15,193
      Likes
      935
      Quote Originally Posted by slayer View Post
      Then how do I do it just for windows?
      It does that for you

      Go to the folder with your Code::Blocks file, then go to bin/Debug. A .exe file should be in there

      If you use standard C++, it will compile on any platform with no change in code Firefox compiles on every major platform, using the same code, with very little preprocessor.
      Last edited by ninja9578; 01-13-2010 at 03:23 AM.

    7. #7
      A Natural The Invisible Man's Avatar
      Join Date
      Nov 2008
      Gender
      Posts
      365
      Likes
      8
      "C++ will let you shoot your foot without warning you. In fact, it will even load the gun for you."

      ~ Allegro User


      Can you see me now?

    8. #8
      khh
      khh is offline
      Remember Achievements:
      1000 Hall Points Veteran First Class
      khh's Avatar
      Join Date
      Jun 2009
      Gender
      Location
      Norway
      Posts
      2,482
      Likes
      1309
      Quote Originally Posted by ninja9578 View Post
      If you use standard C++, it will compile on any platform with no change in code Firefox compiles on every major platform, using the same code, with very little preprocessor.
      There are a lot of things you need system calls for, though, like GUI and scanning directories and such. So Firefox must be using preprocessor directives, or libraries which uses them.

      Quote Originally Posted by slash112 View Post
      Ynot. I'll give you an example. If the program asks you to input something, you would put it in. You would get an instant response, and then the terminal window would instantly shut the moment after the new text is displayed. This is not what you want.
      Console programs are normally opened from the terminal, though. And if you do that, then the terminal doesn't close and you'll see the output. It's just if you open it by double clicking on the executable that you won't see the text, but then that's no how the programs are supposed to work. If you want those kinds of programs you need GUI.

      Funny thing, I've got C++ as a university subject this year. Of the things we'll learn this year, there was only one thing I haven't done before.
      April Ryan is my friend,
      Every sorrow she can mend.
      When i visit her dark realm,
      Does it simply overwhelm.

    9. #9
      FBI agent Ynot's Avatar
      Join Date
      Oct 2005
      Gender
      Location
      Southend, Essex
      Posts
      4,337
      Likes
      14
      Quote Originally Posted by slash112 View Post
      system("PAUSE") means that when I run the program, it doesn't close as soon as it finishes. But it lets you close it by pressing any key.
      Don't do that
      I'm not sure exactly what you mean by "closing" (you mean the terminal window?)
      but good programs finish as soon as they're done, and do not hang for user input unnecessarily

      Say you release a program that takes input from stdin does something and outputs to stdout, exiting 0 on success and any other value on error, errors get sent to stderr

      I would like to be able to say something like

      Code:
      slash112_program || echo "Error $?"
      or
      Code:
      cat some_file | slash112_program | less
      hanging the program for input at the end breaks program flow
      anyway....

      Quote Originally Posted by slayer View Post
      How to I package together my code into an exe or something both windows and macs can open?
      You can't (well, you can, but it's way more trouble than it's worth)
      Either make the various platform & architecture packages yourself
      or the easy route - just release the code
      If the program's useful, people will package it up for their platform / architecture of choice
      (\_ _/)
      (='.'=)
      (")_(")

    10. #10
      Ex Tech Admin Achievements:
      Created Dream Journal Tagger First Class Veteran First Class 10000 Hall Points Populated Wall Referrer Gold Made lots of Friends on DV
      slash112's Avatar
      Join Date
      Nov 2008
      Gender
      Location
      Sunny Scotland
      Posts
      5,113
      Likes
      1567
      DJ Entries
      29
      Quote Originally Posted by ninja9578 View Post
      Code::Blocks automatically pauses the execution at the end for you, you don't need that unless compiling or running outside of the IDE
      Yea, which is why I like to add the system ("PAUSE") at the end all the time. Not that it is important when I am just making stupid little things, but I just like to do it anyway.

    Bookmarks

    Posting Permissions

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