Click here to Skip to main content
16,007,760 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: MFC CString Question Pin
Geert van Horrik11-Jul-05 23:52
Geert van Horrik11-Jul-05 23:52 
GeneralRe: MFC CString Question Pin
Stephen Doty12-Jul-05 6:50
Stephen Doty12-Jul-05 6:50 
GeneralRe: MFC CString Question Pin
Mister Transistor14-Jul-05 2:50
Mister Transistor14-Jul-05 2:50 
GeneralOptimizing Serial Read/Write Routines Pin
CNewbie11-Jul-05 16:33
CNewbie11-Jul-05 16:33 
GeneralRe: Optimizing Serial Read/Write Routines Pin
Bob Stanneveld11-Jul-05 20:36
Bob Stanneveld11-Jul-05 20:36 
GeneralWrite a program that simulates the rolling of two dice. Pin
bartman143711-Jul-05 16:10
bartman143711-Jul-05 16:10 
GeneralRe: Write a program that simulates the rolling of two dice. Pin
Jose Lamas Rios11-Jul-05 16:29
Jose Lamas Rios11-Jul-05 16:29 
GeneralRe: Write a program that simulates the rolling of two dice. Pin
bartman143714-Jul-05 13:10
bartman143714-Jul-05 13:10 
I didn't ask anybody to do it for me. What I asked for was some help in doing it the right way. Not some egomaniac full of himself who just wants to make it hard on somebody trying to learn the right way.
Anyway, I did it myself, it was less aggravation than dealing with people like you.

#include "stdafx.h"

#using <mscorlib.dll>

using namespace System;

int _tmain()
{
//initializing variables
Random *randomNumber = new Random();
int face1;
int face2;
int sum;
const int ARRAY_SIZE = 13;
int frequency__gc[ARRAY_SIZE];
double total;

//simulating the rolling of the two dice
for (int roll = 1; roll<=36000; roll++)
{
face1 = randomNumber->Next(1,7);
face2 = randomNumber->Next(1,7);
sum = face1 + face2;
++frequency__gc[sum];
}

total = 0;

for (int i= 1; i < 13; i++)
total += frequency__gc[ i ];

Console::WriteLine(S"Sum:\tFrequency:");

//output the sum and frequency values
for (int x = 2; x < ARRAY_SIZE; x++)
Console::WriteLine(S"{0}\t{1}", x.ToString(),
frequency__gc[ x ].ToString());

return 0;
}
GeneralRe: Write a program that simulates the rolling of two dice. Pin
Jose Lamas Rios14-Jul-05 17:08
Jose Lamas Rios14-Jul-05 17:08 
Generalone inportant thing Pin
LeeeNN11-Jul-05 14:40
LeeeNN11-Jul-05 14:40 
GeneralRe: one inportant thing Pin
Christian Graus11-Jul-05 16:58
protectorChristian Graus11-Jul-05 16:58 
GeneralRe: one inportant thing Pin
Weiye Chen11-Jul-05 17:28
Weiye Chen11-Jul-05 17:28 
GeneralRe: one inportant thing Pin
Christian Graus11-Jul-05 17:32
protectorChristian Graus11-Jul-05 17:32 
GeneralRe: one inportant thing Pin
Neelesh K J Jain11-Jul-05 20:10
Neelesh K J Jain11-Jul-05 20:10 
GeneralRe: one inportant thing Pin
Christian Graus12-Jul-05 13:10
protectorChristian Graus12-Jul-05 13:10 
GeneralRe: one inportant thing Pin
Bob Stanneveld11-Jul-05 20:38
Bob Stanneveld11-Jul-05 20:38 
GeneralRe: one inportant thing Pin
LeeeNN12-Jul-05 6:57
LeeeNN12-Jul-05 6:57 
GeneralCXX0017: Error: symbol &quot;buf_balance&quot; not found Pin
LeeeNN11-Jul-05 14:09
LeeeNN11-Jul-05 14:09 
GeneralRe: CXX0017: Error: symbol &quot;buf_balance&quot; not found Pin
Indivara11-Jul-05 14:28
professionalIndivara11-Jul-05 14:28 
GeneralRe: CXX0017: Error: symbol &quot;buf_balance&quot; not found Pin
Indivara11-Jul-05 18:19
professionalIndivara11-Jul-05 18:19 
GeneralRe: CXX0017: Error: symbol &quot;buf_balance&quot; not found Pin
Bob Stanneveld11-Jul-05 20:40
Bob Stanneveld11-Jul-05 20:40 
Generalpointer increment Pin
Indivara11-Jul-05 13:07
professionalIndivara11-Jul-05 13:07 
GeneralRe: pointer increment Pin
Jose Lamas Rios11-Jul-05 15:58
Jose Lamas Rios11-Jul-05 15:58 
GeneralRe: pointer increment Pin
Indivara11-Jul-05 18:07
professionalIndivara11-Jul-05 18:07 
GeneralRe: pointer increment Pin
Bob Stanneveld11-Jul-05 20:53
Bob Stanneveld11-Jul-05 20:53 

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.