Click here to Skip to main content
15,889,116 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalbyte array Pin
Anonymous12-Nov-04 7:57
Anonymous12-Nov-04 7:57 
GeneralRe: byte array Pin
Budric B.12-Nov-04 8:15
Budric B.12-Nov-04 8:15 
GeneralInheritance Pin
0v3rloader12-Nov-04 7:03
0v3rloader12-Nov-04 7:03 
GeneralRe: Inheritance Pin
Budric B.12-Nov-04 8:00
Budric B.12-Nov-04 8:00 
GeneralRe: Inheritance Pin
Chris Meech12-Nov-04 8:48
Chris Meech12-Nov-04 8:48 
GeneralDatabase Day/Month switching to Month/Day Pin
DRHuff12-Nov-04 6:59
DRHuff12-Nov-04 6:59 
GeneralRe: Database Day/Month switching to Month/Day Pin
Chris Meech12-Nov-04 8:42
Chris Meech12-Nov-04 8:42 
QuestionMy stack is corrupted?!? Pin
Nathan Addy12-Nov-04 5:09
Nathan Addy12-Nov-04 5:09 
Hey,
I was just fooling around with what appeared to me to be a relatively straightforward bit of code when Visual Studio gave me with the error that "the stack around the variable 'count' was corrupted". I ran it in the debugger and everything looked fine, up until the moment the error popped up, which was between return 0; and the closing brace. The problem also seems to be dependent on the value passed to srand(). I would assume it had something to do with the program being unable to deallocate its memory or something, but I really don't have a good guess. Any ideas?

<br />
int main()<br />
{	<br />
	int count[10]={0};<br />
	srand(3);<br />
	for(int x=0;x!=50000;x++)<br />
	{	<br />
		   count[(int)(rand()*10/RAND_MAX)]++;<br />
	}<br />
<br />
	for(int i=0;i!=10;i++) <br />
{<br />
cout<<"count["<

AnswerRe: My stack is corrupted?!? Pin
John M. Drescher12-Nov-04 5:27
John M. Drescher12-Nov-04 5:27 
GeneralRe: My stack is corrupted?!? Pin
Nathan Addy12-Nov-04 5:34
Nathan Addy12-Nov-04 5:34 
AnswerRe: My stack is corrupted?!? Pin
Joaquín M López Muñoz12-Nov-04 5:30
Joaquín M López Muñoz12-Nov-04 5:30 
Questionhow to backup database non remote computer? Pin
venadder12-Nov-04 5:02
venadder12-Nov-04 5:02 
AnswerRe: how to backup database non remote computer? Pin
John M. Drescher12-Nov-04 5:11
John M. Drescher12-Nov-04 5:11 
GeneralRe: how to backup database non remote computer? Pin
venadder12-Nov-04 5:37
venadder12-Nov-04 5:37 
GeneralRe: how to backup database non remote computer? Pin
John M. Drescher12-Nov-04 5:55
John M. Drescher12-Nov-04 5:55 
GeneralRe: how to backup database non remote computer? Pin
venadder12-Nov-04 6:24
venadder12-Nov-04 6:24 
GeneralRe: how to backup database non remote computer? Pin
John M. Drescher12-Nov-04 6:46
John M. Drescher12-Nov-04 6:46 
GeneralRe: how to backup database non remote computer? Pin
venadder12-Nov-04 7:03
venadder12-Nov-04 7:03 
GeneralRe: how to backup database non remote computer? Pin
John M. Drescher12-Nov-04 7:09
John M. Drescher12-Nov-04 7:09 
QuestionHow To Create Sys Env Var Programmatically? Pin
Spoodles12-Nov-04 4:58
Spoodles12-Nov-04 4:58 
Generalcrashes when I pass data from dialog to View, Need help! Pin
Ibana12-Nov-04 4:55
Ibana12-Nov-04 4:55 
Generalunreferenced local variable Pin
yellowtulips12-Nov-04 4:30
yellowtulips12-Nov-04 4:30 
GeneralRe: unreferenced local variable Pin
Manfred Staiger12-Nov-04 4:44
Manfred Staiger12-Nov-04 4:44 
GeneralRe: unreferenced local variable Pin
Michael Dunn12-Nov-04 7:03
sitebuilderMichael Dunn12-Nov-04 7:03 
GeneralMDI Application Pin
Jnewg512-Nov-04 4:16
Jnewg512-Nov-04 4:16 

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.