Return to Snippet

Revision: 41693
at February 22, 2011 14:55 by ruler501


Initial Code
/* rand example: guess the number */
#include <cstdlib>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
using namespace std;

int randomgen(int range, int bottom);

int main()
{
	for(int i=0; i<5;i++)
	{
		int num;
		num = randomgen(5, 1);
		cout << num;
	}
}

int randomgen(int range, int bottom)
{
	int iSecret;
	srand(time(NULL));
	iSecret = rand()%range+bottom;
	return iSecret;
}

Initial URL

                                

Initial Description
Errors
'Chapter1.exe': Loaded 'E:\Book\Software\Chapter1\Release\Chapter1.exe', Symbols loaded.
'Chapter1.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', Cannot find or open the PDB file
'Chapter1.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', Cannot find or open the PDB file
'Chapter1.exe': Loaded 'C:\Program Files\Alwil Software\Avast5\snxhk.dll', Cannot find or open the PDB file
'Chapter1.exe': Loaded 'C:\WINDOWS\system32\msvcp100.dll', Symbols loaded.
'Chapter1.exe': Loaded 'C:\WINDOWS\system32\msvcr100.dll', Symbols loaded.
'Chapter1.exe': Loaded 'C:\WINDOWS\system32\shimeng.dll', Cannot find or open the PDB file
'Chapter1.exe': Unloaded 'C:\WINDOWS\system32\shimeng.dll'
The program '[756] Chapter1.exe: Native' has exited with code 0 (0x0).

Initial Title
Random code errors

Initial Tags

                                

Initial Language
C++