Click here to Skip to main content
15,892,927 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Arbitrary - arithmetic precision Pin
nowrocktheworld13-Nov-09 7:55
nowrocktheworld13-Nov-09 7:55 
GeneralRe: Arbitrary - arithmetic precision Pin
Richard MacCutchan13-Nov-09 9:17
mveRichard MacCutchan13-Nov-09 9:17 
GeneralRe: Arbitrary - arithmetic precision Pin
Rajesh R Subramanian13-Nov-09 16:24
professionalRajesh R Subramanian13-Nov-09 16:24 
GeneralRe: Arbitrary - arithmetic precision Pin
nowrocktheworld14-Nov-09 1:20
nowrocktheworld14-Nov-09 1:20 
QuestionBubblesort help Pin
kbury13-Nov-09 4:44
kbury13-Nov-09 4:44 
AnswerRe: Bubblesort help Pin
«_Superman_»13-Nov-09 5:03
professional«_Superman_»13-Nov-09 5:03 
AnswerRe: Bubblesort help Pin
David Crow13-Nov-09 5:06
David Crow13-Nov-09 5:06 
GeneralRe: Bubblesort help Pin
kbury13-Nov-09 6:37
kbury13-Nov-09 6:37 
I have tried this, prints out but will not generate random numbers

#include <stdio.h>
#include <stdlib.h>
#include<time.h>

#define SIZE 6
#define MAX 53

void printArray(int N[], int T);
void fillArray(int N[], int T);

int main(void)
{
srand(time(NULL));

int PICKED[] = {0,0,0,0,0,0};

fillArray(PICKED, SIZE);
printArray(PICKED, SIZE);

return 0;
}

void fillArray(int N[], int T)
{
for(int P=0; P<SIZE; P++)
{
N[P] = rand() % 52+1;

for(int PASS=0; PASS<P; PASS++)
{
if(N[PASS] == N[P])
{
N[P] = (int) (rand()%52 +1);
P=-1;
}
}
}
}


void printArray(int N[], int T)
{
    int PASS, P;

    for(P=0; P<SIZE-1; P++)
    {

        for(PASS = P + 1; PASS < SIZE; PASS++)
        {
	    if(N[P]>N[PASS])
            {
       	        T = N[PASS];
		N[P] = N[PASS];
		N[P] = T;
            }
        }
    }

    printf("\nLOTTO PICKS\n\n");
    for(int P=0; P<SIZE; P++)
       printf("%d ", N[P]);

    printf("\n");

}

QuestionRe: Bubblesort help Pin
David Crow13-Nov-09 6:40
David Crow13-Nov-09 6:40 
AnswerRe: Bubblesort help Pin
kbury13-Nov-09 6:48
kbury13-Nov-09 6:48 
QuestionRe: Bubblesort help Pin
David Crow13-Nov-09 7:42
David Crow13-Nov-09 7:42 
GeneralRe: Bubblesort help Pin
CPallini13-Nov-09 7:13
mveCPallini13-Nov-09 7:13 
GeneralRe: Bubblesort help Pin
kbury13-Nov-09 7:23
kbury13-Nov-09 7:23 
GeneralRe: Bubblesort help Pin
CPallini13-Nov-09 8:05
mveCPallini13-Nov-09 8:05 
Questionhow can i retrieve the desitnation path of the icons on the desktop Pin
nenfa13-Nov-09 2:02
nenfa13-Nov-09 2:02 
AnswerRe: how can i retrieve the desitnation path of the icons on the desktop Pin
David Crow13-Nov-09 3:12
David Crow13-Nov-09 3:12 
GeneralRe: how can i retrieve the desitnation path of the icons on the desktop Pin
nenfa14-Nov-09 20:27
nenfa14-Nov-09 20:27 
AnswerRe: how can i retrieve the desitnation path of the icons on the desktop Pin
David Crow15-Nov-09 8:28
David Crow15-Nov-09 8:28 
AnswerRe: how can i retrieve the desitnation path of the icons on the desktop Pin
«_Superman_»13-Nov-09 5:04
professional«_Superman_»13-Nov-09 5:04 
GeneralRe: how can i retrieve the desitnation path of the icons on the desktop Pin
nenfa14-Nov-09 20:25
nenfa14-Nov-09 20:25 
AnswerRe: how can i retrieve the desitnation path of the icons on the desktop Pin
nenfa14-Nov-09 22:18
nenfa14-Nov-09 22:18 
QuestionHow To Overcome DEBUG ASSERTION FAILED In VC++ Pin
ram8413-Nov-09 0:31
ram8413-Nov-09 0:31 
AnswerRe: How To Overcome DEBUG ASSERTION FAILED In VC++ Pin
Rajesh R Subramanian13-Nov-09 0:54
professionalRajesh R Subramanian13-Nov-09 0:54 
GeneralRe: How To Overcome DEBUG ASSERTION FAILED In VC++ Pin
CPallini13-Nov-09 3:29
mveCPallini13-Nov-09 3:29 
JokeRe: How To Overcome DEBUG ASSERTION FAILED In VC++ Pin
Rajesh R Subramanian13-Nov-09 3:34
professionalRajesh R Subramanian13-Nov-09 3:34 

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.