|
From: Scott S. <age...@co...> - 2004-09-11 16:03:02
|
Three solutions:
1. Run your program from a console prompt
2. Include cstdlib and add the line system("APUSE); before return 0
3. Create a useless variable and add a cin statement for it before the
return 0
--Scott Simontis--
Meyer von Landenhausen wrote:
> hi please take a look at the source:
>
> #include <ctime>
> #include <iostream>
> using namespace std;
>
> int main()
> {
> char buffer[3];
> int i,r,temp;
> int nums[50];
>
>
> for(i = 1; i < 50; i++)
> {
> r = (rand() % 49) + 1;
> temp = nums[i]; nums[i] = nums[r] = temp;
> }
>
>
> cout << "Your six lucky numbers are...\n";
> cout << itoa(nums[1], buffer, 10) << " ";
> cout << itoa(nums[2], buffer, 10) << " ";
> cout << itoa(nums[3], buffer, 10) << " ";
> cout << itoa(nums[4], buffer, 10) << " ";
> cout << itoa(nums[5], buffer, 10) << " ";
> cout << itoa(nums[6], buffer, 10) << " ";
> cout << endl;
> return 0;
> }
>
>
> i cant run without that win2k pro automaticly closes the apllication
> after i ran it - what kind of code should i inserted therefore i take
> a look first at the code before it closes it!?
>
> btw the prog shall creat 6 different 2-digit long numbers.
>
> thx a lot guys
>
> _________________________________________________________________
> It's fast, it's easy and it's free. Get MSN Messenger today!
> http://www.msn.co.uk/messenger
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
> Project Admins to receive an Apple iPod Mini FREE for your judgement on
> who ports your project to Linux PPC the best. Sponsored by IBM.
> Deadline: Sept. 13. Go here: http://sf.net/ppc_contest.php
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|