keep getting this error The program '[2392] program1.exe: Native' has exited with code 0 (0x0) and program closes down

for some reason my program shuts down after inputting the variables.
here is my main.cpp and my filer.cpp which the program is suppose to run after inputting the values by user.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#include "utility.h"
#include "filer.h"


int main()
{
	
	int n = 0;
	int range = 0;
	bool truly_random = 0;
	string file_name;
	int c = 0;
	
	// I/O for max numbers
	cout << "How many numbers would you like to be put in this file?" << endl;
	cin >> n;
	cout << endl;

	// I/O for range of numbers
	cout << "What would you like the ceiling number to be? (the floor number is pre-set at 0)" << endl;
	cin >> range;
	cout << endl;

	// I/O for file name
	cout << "What would you like the name of your file to be?" << endl;
	cin >> file_name;
	cout << endl;

	// I/O for decision on truly random or psuedorandom
	cout << "Would you like your numbers to be Psuedorandom or Truly random?" << endl;
	cout << "If you would like Psuedorandom press '1' if Truly random press '2'" << endl;
	cin >> c;
	if(c == '1')
	{
		truly_random = true;
	}
	else
	{
		truly_random = false;
	}
	cout << endl;

	filer run;
	run.makefile(n, range, truly_random, file_name);

} // end main 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include "utility.h"
#include "filer.h"



void filer::makefile(int n, int range, bool truly_random, string file_name)
{	
	int i;
	for(i = 0; i < n; i++)
	{
		if(truly_random = true)
		{
			n = rand()% range;
			cout << n << endl;
		}
		else
		{
			srand(int(time(NULL)));
			n = rand()% range;
			cout << n << endl;
		}
	}	

	
}// end filer.makefile 
Topic archived. No new replies allowed.