Click here to Skip to main content
15,917,642 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: casting - simple question Pin
Alexandru Savescu6-Aug-03 23:30
Alexandru Savescu6-Aug-03 23:30 
GeneralRe: casting - simple question Pin
Ryan Binns6-Aug-03 23:49
Ryan Binns6-Aug-03 23:49 
GeneralRe: casting - simple question Pin
devvvy7-Aug-03 1:14
devvvy7-Aug-03 1:14 
Generalhelp about Artificial Intelligence and Graphics Pin
Pham Quang Hai6-Aug-03 18:18
Pham Quang Hai6-Aug-03 18:18 
Generalhelp about Artificial Intelligence and Graphics Pin
Pham Quang Hai6-Aug-03 18:13
Pham Quang Hai6-Aug-03 18:13 
GeneralHelp with program Pin
DaveE9th6-Aug-03 16:18
DaveE9th6-Aug-03 16:18 
GeneralRe: Help with program Pin
Maximilien6-Aug-03 16:31
Maximilien6-Aug-03 16:31 
GeneralRe: Help with program Pin
Terry O'Nolley6-Aug-03 16:50
Terry O'Nolley6-Aug-03 16:50 
Some of the most immediate problems are your #includes aren't correct. Also (unless you have a custom stdlib.h) there is a typo - your first include should be stdlib, not cstdlib. the #includes should look like #include <stdlib.h> (actually, you probably had it correct, but because they look like HTML tags to the server processor, they got stripped). Also namespace is a C++ specific feature but in C++ you can't have locally defined functions (your int nrand(int n). You'll need to break out your nrand and call it from your main.

Create a NRand class and header file and save them in their own source files. #include the header in your main source file. Then you'll need to call the class with an integer. I didn't even look at the logic contained in your loop. Try to get a good compile and then check back in!












GeneralRe: Help with program Pin
bugtesting6-Aug-03 17:25
bugtesting6-Aug-03 17:25 
GeneralRe: Help with program Pin
jhwurmbach6-Aug-03 21:50
jhwurmbach6-Aug-03 21:50 
GeneralRe: Help with program Pin
DaveE9th7-Aug-03 0:52
DaveE9th7-Aug-03 0:52 
GeneralPop-up windows Pin
Hktam6-Aug-03 15:40
Hktam6-Aug-03 15:40 
GeneralRe: Pop-up windows Pin
PJ Arends6-Aug-03 21:48
professionalPJ Arends6-Aug-03 21:48 
GeneralRe: Pop-up windows Pin
Hktam6-Aug-03 21:53
Hktam6-Aug-03 21:53 
GeneralChecking the screen res Pin
bneacetp6-Aug-03 15:29
bneacetp6-Aug-03 15:29 
GeneralRe: Checking the screen res Pin
Hktam6-Aug-03 15:51
Hktam6-Aug-03 15:51 
GeneralRe: Checking the screen res Pin
bneacetp6-Aug-03 16:52
bneacetp6-Aug-03 16:52 
GeneralRe: Checking the screen res Pin
xxhimanshu6-Aug-03 19:01
xxhimanshu6-Aug-03 19:01 
GeneralRe: Checking the screen res Pin
Dangleberry7-Aug-03 2:50
sussDangleberry7-Aug-03 2:50 
Generala clipboard-question too Pin
Chao Zuo6-Aug-03 15:11
Chao Zuo6-Aug-03 15:11 
GeneralRe: a clipboard-question too Pin
Chao Zuo6-Aug-03 16:07
Chao Zuo6-Aug-03 16:07 
GeneralPacking and running files with protection Pin
Kayembi6-Aug-03 14:44
Kayembi6-Aug-03 14:44 
GeneralRe: Packing and running files with protection Pin
Andrew Walker6-Aug-03 15:13
Andrew Walker6-Aug-03 15:13 
GeneralRe: Packing and running files with protection Pin
Kayembi7-Aug-03 0:20
Kayembi7-Aug-03 0:20 
GeneralMFC picture control Pin
rapace6-Aug-03 13:20
rapace6-Aug-03 13:20 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.