Click here to Skip to main content
15,908,020 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: enum Datatype: Overloaded function differ only by return type error...? Pin
Richard MacCutchan15-Jun-16 21:46
mveRichard MacCutchan15-Jun-16 21:46 
AnswerRe: enum Datatype: Overloaded function differ only by return type error...? Pin
leon de boer15-Jun-16 22:41
leon de boer15-Jun-16 22:41 
QuestionSHA1- CheckSum Example in Microsoft Visual C++ 6.0 Pin
Member 1248511614-Jun-16 2:39
Member 1248511614-Jun-16 2:39 
QuestionRe: SHA1- CheckSum Example in Microsoft Visual C++ 6.0 Pin
David Crow14-Jun-16 2:43
David Crow14-Jun-16 2:43 
AnswerRe: SHA1- CheckSum Example in Microsoft Visual C++ 6.0 Pin
Member 1248511614-Jun-16 5:05
Member 1248511614-Jun-16 5:05 
QuestionRe: SHA1- CheckSum Example in Microsoft Visual C++ 6.0 Pin
David Crow14-Jun-16 5:23
David Crow14-Jun-16 5:23 
SuggestionRe: SHA1- CheckSum Example in Microsoft Visual C++ 6.0 Pin
Peter_in_278014-Jun-16 16:53
professionalPeter_in_278014-Jun-16 16:53 
GeneralRe: SHA1- CheckSum Example in Microsoft Visual C++ 6.0 Pin
Member 1248511614-Jun-16 19:18
Member 1248511614-Jun-16 19:18 
GeneralRe: SHA1- CheckSum Example in Microsoft Visual C++ 6.0 Pin
Jochen Arndt14-Jun-16 21:19
professionalJochen Arndt14-Jun-16 21:19 
GeneralRe: SHA1- CheckSum Example in Microsoft Visual C++ 6.0 Pin
leon de boer15-Jun-16 4:11
leon de boer15-Jun-16 4:11 
GeneralRe: SHA1- CheckSum Example in Microsoft Visual C++ 6.0 Pin
David Crow15-Jun-16 1:53
David Crow15-Jun-16 1:53 
QuestionLarge project how to seprate definition and declaration? Pin
Hassan Syed112-Jun-16 9:47
Hassan Syed112-Jun-16 9:47 
AnswerRe: Large project how to seprate definition and declaration? Pin
leon de boer12-Jun-16 17:38
leon de boer12-Jun-16 17:38 
GeneralRe: Large project how to seprate definition and declaration? Pin
Hassan Syed112-Jun-16 18:34
Hassan Syed112-Jun-16 18:34 
GeneralRe: Large project how to seprate definition and declaration? Pin
Jochen Arndt12-Jun-16 21:47
professionalJochen Arndt12-Jun-16 21:47 
GeneralRe: Large project how to seprate definition and declaration? Pin
leon de boer12-Jun-16 22:37
leon de boer12-Jun-16 22:37 
GeneralRe: Large project how to seprate definition and declaration? Pin
Hassan Syed113-Jun-16 1:25
Hassan Syed113-Jun-16 1:25 
GeneralRe: Large project how to seprate definition and declaration? Pin
Richard MacCutchan13-Jun-16 1:46
mveRichard MacCutchan13-Jun-16 1:46 
GeneralRe: Large project how to seprate definition and declaration? Pin
leon de boer13-Jun-16 4:03
leon de boer13-Jun-16 4:03 
GeneralRe: Large project how to seprate definition and declaration? Pin
Hassan Syed113-Jun-16 4:54
Hassan Syed113-Jun-16 4:54 
SuggestionRe: Large project how to seprate definition and declaration? Pin
David Crow13-Jun-16 5:23
David Crow13-Jun-16 5:23 
GeneralRe: Large project how to seprate definition and declaration? Pin
leon de boer13-Jun-16 16:19
leon de boer13-Jun-16 16:19 
GeneralRe: Large project how to seprate definition and declaration? Pin
Hassan Syed113-Jun-16 19:47
Hassan Syed113-Jun-16 19:47 
AnswerRe: Large project how to seprate definition and declaration? Pin
David Crow14-Jun-16 2:47
David Crow14-Jun-16 2:47 
GeneralRe: Large project how to seprate definition and declaration? Pin
leon de boer14-Jun-16 6:06
leon de boer14-Jun-16 6:06 
You are not thinking like a programmer ... at the moment your answers are not needed as you just display them to the console

So one easy option to patch your code in Calculation.CPP is this
void input_Area(void)  // ** Pt1 here you declare you are going to return nothing AKA a void
{
   float width = 0, length = 0, answer = 0;
   cout << "Enter the width of rectangle :";
   cin >> width;
   cout << "Enter the length of rectangle :";
   cin >> length;
   answer = rectangleArea(width, length);
   cout << "The area of Rectangle is : " << answer << endl;
}

That matches your .H header file you don't have to change anything
#ifndef _CALCULATION_H
#define _CALCULATION_H

void input_Func(void); //Input function of text.
void input_Area(void); //Input function of Area. **** FIXED NOW MATCHES THE .CPP file
void input_Trap(void); //Input function of Trapezoid.  *** STILL BUGGED .CPP says it returns a float this says void
float rectangle_Area (float , float); //Declaration for Rectangle Area.
float trapezoid_Area (float , float, float); //Declaration for Trapezoid Area.

#endif

So you could go and fix input_Trap in the same way I am leaving that as an exercise .. problem fixed.

So there is another alternative which is to return the answer in Calculation.cpp
float input_Area(void)  // ** Pt1 here you declare you are going to return a float
{
   float width = 0, length = 0, answer = 0;
   cout << "Enter the width of rectangle :";
   cin >> width;
   cout << "Enter the length of rectangle :";
   cin >> length;
   answer = rectangleArea(width, length);
   cout << "The area of Rectangle is : " << answer << endl;

   return (answer);        // * So return the answer like you said you would at Pt1
}

Now you need to fix the header file Calculation.H
#ifndef _CALCULATION_H
#define _CALCULATION_H

void input_Func(void); //Input function of text.
float input_Area(void); //Input function of Area. **** FIXED NOW MATCHES THE .CPP file above
void input_Trap(void); //Input function of Trapezoid.  *** STILL BUGGED .CPP says it returns a float this still says void
float rectangle_Area (float , float); //Declaration for Rectangle Area.
float trapezoid_Area (float , float, float); //Declaration for Trapezoid Area.

#endif

So you could go and fix input_Trap in the same way I am leaving that as an exercise .. problem fixed again.

Look carefully at both answers all that changed is whether you return answer or not. In both cases the .H file matches the .CPP file match.

Either answer is technically correct, there is no way for me to decide because it depends what you intend to do with the unit.
In vino veritas

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.