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

C / C++ / MFC

 
QuestionWINVER and Graphics projects using glut Pin
adonisv28-Oct-05 15:40
adonisv28-Oct-05 15:40 
Questionneed help in speech recognitiion Pin
gr8coaster32928-Oct-05 13:22
gr8coaster32928-Oct-05 13:22 
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 
Hello

I'm not sure if this is a beginners forum, but I will start here. I am a beginning C++ student and have a couple of mini-projects invloving fractions that I need some guidance on.

First the assignments:

1. Write a Fraction-Reduction program that takes in any fraction (maybe with denominator not equal to 0 or 1), and reduces it lowest terms. The function prototype will take two integer variables passed by reference.

2. Write a function that takes in any number and returns its whole and fractional parts as outputs. Like 6.44 would return int 6 and float 0.44.

My trouble:

On #1: I understand how reference passing is working, that the variables values in main's variables can be changed by the function. What I cant figure out is how to write something that will find the greatest common factor of any two numbers entered. I understand the math behind it but I cant translate that math to the program, and get it the correct place in main or the function and have it work.

On #2: This problem came from the chapter on reference parameters also. So is there a way to do this problem with the user entering one single float? Or is the trick to cin what the user enters in a format that allows to be updated invidually by reference from a function?

If my code is needed I can post it. If there is another forum I need to be at, please let me know. Thank you sincerely for any help.

JB
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 
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 

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.