Author Topic: making a working .exe than i can send to other people  (Read 5494 times)

seventhmoon

  • Guest
making a working .exe than i can send to other people
« on: February 06, 2006, 09:09:48 pm »
I'm new to C++. I've just made my first Hello World application, and I've run it and it runs fine. I was wondering  how I can 'Publish' a working .exe that I can send to other people (just an example). There is a exe in my project folder but when i click on it it pops up very fast and the closes.


sethjackson

  • Guest
Re: making a working .exe than i can send to other people
« Reply #1 on: February 06, 2006, 09:39:32 pm »
Add this before return 0;

Code: cpp
std::cout << std::endl << "Press Enter to exit.";

std::cin.get();

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: making a working .exe than i can send to other people
« Reply #2 on: February 06, 2006, 09:40:46 pm »
To publish a program, you can upload it to a web server or ftp server.

To prevent your program from closing (which is perfectly normal, by the way), you can for example wait for keyboard input. Look at the C/C++ new project template to learn how that is done (or look at a "learning C" tutorial.

Please do note that there are forums and collections of frequently asked questions dedicated to general C++ questions such as these (googling for C++ faq may help). We are a Code::Blocks forum.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

sethjackson

  • Guest
Re: making a working .exe than i can send to other people
« Reply #3 on: February 06, 2006, 09:45:40 pm »
To prevent your program from closing (which is perfectly normal, by the way), you can for example wait for keyboard input. Look at the C/C++ new project template to learn how that is done (or look at a "learning C" tutorial.

Maybe that should be a "learning C++" tutorial.  :lol:

Yeah I just told him how to wait for input. std::cin.get() :) Although it only waits for a carrige return IIRC.

Some tuts

http://www.cprogramming.com/tutorial/lesson1.html
http://cplusplus.com/doc/tutorial/

And a nice C\C++ reference (The STL reference helps me alot).

http://www.cppreference.com/index.html

seventhmoon

  • Guest
Re: making a working .exe than i can send to other people
« Reply #4 on: February 07, 2006, 09:00:12 am »
Add this before return 0;

Code: cpp
std::cout << std::endl << "Press Enter to exit.";

std::cin.get();

Od.. Even after i added that it still does it.

sethjackson

  • Guest
Re: making a working .exe than i can send to other people
« Reply #5 on: February 07, 2006, 05:18:08 pm »
Are you making a console program or a GUI program????

Post you full code here if you can please. :)

Offline Vampyre_Dark

  • Regular
  • ***
  • Posts: 255
  • Hello!
    • Somewhere Over The Rainbow...
Re: making a working .exe than i can send to other people
« Reply #6 on: February 07, 2006, 07:23:12 pm »
system("PAUSE"); will work too, but it's ugly.

Don't let that stop you from using it until you become more proficient in C++ though.
C::B Wishlist
~BOYCOTT THE EVIL YELLOW BOXES~