I got a issue when I cout
a function. The next code is where the IDE
gives me the error:
cout << "La cuerda de raiz tiene valor de: "<< chord.rootChord(const clsSpanCalculation&)
<< "La cuerda de punta tiene valor de: " << chord.tipChord(clsSpanCalculation &sC);
The classes clsSpanCalculation
and clsChordParameters
are defined in main as span and chord respectively.
I am using a header, the classes are developed there. The headers are these ones:
#ifndef __IASS_Project__wingSizing__
#define __IASS_Project__wingSizing__
#include <stdio.h>
#include <cmath>
class clsSpanCalculation{
float wingArea, aspectRatio;
public:
clsSpanCalculation(){}
float get_wingArea(void)const{return wingArea;}
void set_wingArea(float Sw){wingArea = Sw;}
float get_aspectRatio(void)const{return aspectRatio;}
void set_aspectRatio(float AR){aspectRatio = AR;}
float span()const{
float span;
span = sqrt(aspectRatio*wingArea);
return span;
}
};
class clsChordParameters{
float percentRectArea, percertTrapArea, taperRatio;
public:
float get_percentRectArea(void)const{return percentRectArea;}
void set_percentRectArea(float Srect){percentRectArea = Srect;}
float get_percentTrapArea(void)const{return percertTrapArea;}
void set_percentTrapArea(float Strap){percertTrapArea = Strap;}
float get_taperRatio(void)const{return taperRatio;}
void set_taperRatio(float lambda){taperRatio = lambda;}
float rootChord (const clsSpanCalculation &clsSpanCalculation){
float rootChord, lambdaplus;
lambdaplus= taperRatio + 1;
rootChord = (2*(clsSpanCalculation.get_wingArea()*(percentRectArea*(lambdaplus)+(2*percertTrapArea))))/((clsSpanCalculation.span()*lambdaplus)/2);
return rootChord;
}
float tipChord (const clsSpanCalculation &sC){
float rootChord, tipChord, lambdaplus;
lambdaplus= taperRatio + 1;
rootChord = (2*(sC.get_wingArea()*(percentRectArea*(lambdaplus)+(2*percertTrapArea))))/((sC.span()*lambdaplus)/2);
tipChord = rootChord*taperRatio;
return tipChord;
}
};
#endif /* defined(__IASS_Project__wingSizing__) */
The error that the IDE gives me is this one:
expected primary-expression before "const"