Click here to Skip to main content
15,920,670 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: need help in speech recognitiion Pin
Ravi Bhavnani28-Oct-05 16:54
professionalRavi Bhavnani28-Oct-05 16:54 
QuestionRe: need help in speech recognitiion Pin
gr8coaster32929-Oct-05 7:01
gr8coaster32929-Oct-05 7:01 
AnswerRe: need help in speech recognitiion Pin
Ravi Bhavnani29-Oct-05 7:07
professionalRavi Bhavnani29-Oct-05 7:07 
Questionparallel port Pin
jama68728-Oct-05 12:57
jama68728-Oct-05 12:57 
AnswerRe: parallel port Pin
Indivara28-Oct-05 17:19
professionalIndivara28-Oct-05 17:19 
QuestionA couple of Reference Function questions Pin
j4express28-Oct-05 12:45
j4express28-Oct-05 12:45 
AnswerRe: A couple of Reference Function questions Pin
Prakash Nadar28-Oct-05 17:34
Prakash Nadar28-Oct-05 17:34 
AnswerRe: A couple of Reference Function questions Pin
ddupre28-Oct-05 22:54
ddupre28-Oct-05 22:54 
#1> This is some really old code laying around in the depths of my harddrive, but it should be exactly what you are looking for. It's not really a programming problem as much as a math problem, luckily Euclidean did all the work for us many years ago.
Euclidean algorithm for finding the Greatest Common Denominator:
void GCD(int &Nume, int &Denom)
{
    int a= Nume;
    int b= Denom
    int temp = a % b;

    while (temp > 0) //Keep searching till a % b evenly
    {
        a = b;  //Cycle Values
        b = temp;
        temp = a % b;
    }
    Nume= Nume / b;
    Denom= Denom /b;
}


#2> Ok, this one is easier than it seems. So lets say we the float 6.44 from the user. Now the easy part, casting a floating point into an integer will automaticall truncate the number, therefore leaving us with only the whole number, simple subtraction does the rest.

float f1 = 6.44f;
int Int1= (int) f1; //Truncate 6.44 to int 6
f1= f1 - Int1;      // 6.44 -6 = 0.44

QuestionCompiling Errors Pin
RedDragon2k28-Oct-05 9:05
RedDragon2k28-Oct-05 9:05 
AnswerRe: Compiling Errors Pin
David Crow28-Oct-05 9:40
David Crow28-Oct-05 9:40 
AnswerRe: Compiling Errors Pin
Chris Losinger28-Oct-05 9:56
professionalChris Losinger28-Oct-05 9:56 
QuestionHow to sleep my displays (monitors)? Pin
bitpusher28-Oct-05 8:40
bitpusher28-Oct-05 8:40 
AnswerRe: How to sleep my displays (monitors)? Pin
Blake Miller28-Oct-05 11:54
Blake Miller28-Oct-05 11:54 
Questionruntime error Pin
hamavreg28-Oct-05 8:19
hamavreg28-Oct-05 8:19 
AnswerRe: runtime error Pin
Maximilien28-Oct-05 8:47
Maximilien28-Oct-05 8:47 
QuestionC++ Financial Library Pin
73Zeppelin28-Oct-05 7:24
73Zeppelin28-Oct-05 7:24 
QuestionRe: C++ Financial Library Pin
David Crow28-Oct-05 7:38
David Crow28-Oct-05 7:38 
AnswerRe: C++ Financial Library Pin
73Zeppelin28-Oct-05 7:43
73Zeppelin28-Oct-05 7:43 
GeneralRe: C++ Financial Library Pin
Bob Flynn28-Oct-05 7:52
Bob Flynn28-Oct-05 7:52 
QuestionPDB Files Pin
Chintoo72328-Oct-05 7:05
Chintoo72328-Oct-05 7:05 
AnswerRe: PDB Files Pin
Blake Miller28-Oct-05 11:56
Blake Miller28-Oct-05 11:56 
Questionprogress bar Pin
Manu_8128-Oct-05 6:15
Manu_8128-Oct-05 6:15 
AnswerRe: progress bar Pin
David Crow28-Oct-05 6:47
David Crow28-Oct-05 6:47 
Questioncaret, mouse and keyboard Pin
Richard_4828-Oct-05 6:07
Richard_4828-Oct-05 6:07 
AnswerRe: caret, mouse and keyboard Pin
Chris Losinger28-Oct-05 7:14
professionalChris Losinger28-Oct-05 7:14 

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.