C:\Users\Admin\Desktop\Ejercicios de clases\tarea de senos y cosenos\Cpp1.cpp(36) : error C2556: 'int __thiscall funciones::Seno(long)' : overloaded function differs only by return type from 'long __thiscall funciones::Seno(long)'
C:\Users\Admin\Desktop\Ejercicios de clases\tarea de senos y cosenos\Cpp1.cpp(14) : see declaration of 'Seno'
C:\Users\Admin\Desktop\Ejercicios de clases\tarea de senos y cosenos\Cpp1.cpp(36) : error C2371: 'Seno' : redefinition; different basic types
C:\Users\Admin\Desktop\Ejercicios de clases\tarea de senos y cosenos\Cpp1.cpp(14) : see declaration of 'Seno'
C:\Users\Admin\Desktop\Ejercicios de clases\tarea de senos y cosenos\Cpp1.cpp(60) : error C2264: 'Seno' : error in function definition or declaration; function not called
Error executing cl.exe.
Your definition of funciones::Seno() doesn't match the declaration of the same function. long Seno (long);funciones::Seno (long){
Actually, none of your declarations match the definitions. It's illegal to omit the return type in C++.
I've made some changes in the program, but for some reason it doesn't return me the sine of that number in radians. Why is that? i've cuadruple checked it!!
This program is based in the Taylor's series aproximation.
#include<iostream>
using namespace std;
class funciones {
float Sumatoria;
int Factorial (int);
int Potencia (int, int);
bool Turno;
public:
float Seno (float);
float Coseno (float);
}funcion;
int funciones::Factorial (int b){
int factor=1;
for(b;b>=1;b--){
factor*=b;
}
return (factor);
}
int funciones::Potencia (int c,int Numero){
int Resultado=1;
for(c;c>=1;c--){
Resultado*=Numero;
}
return (Resultado);
}