Hello all. I am writing a program that is supposed to help me learn about enumeration data types in C++. The current trouble is that the compiler doesn't like my enum usage when trying to use the new data type as I would other data types. I am getting the error "redeclared as different kind of symbol" when compiling my trangleShape function. Take a look at the relevant code. Any insight is appreciated! Thanks!
(All functions are their own .cpp files.)
header file
#ifndef HEADER_H_INCLUDED
#define HEADER_H_INCLUDED
#include <iostream>
#include <iomanip>
using namespace std;
enum triangleType {noTriangle, scalene, isoceles, equilateral};
//prototypes
void extern input(float&, float&, float&);
triangleType extern triangleShape(float, float, float);
/*void extern output (float, float, float);*/
void extern myLabel(const char *, const char *);
#endif // HEADER_H_INCLUDED
main function
//8.1 main
// this progam...
#include "header.h"
int main()
{
float sideLength1, sideLength2, sideLength3;
char response;
do //main loop
{
input (sideLength1, sideLength2, sideLength3);
triangleShape (sideLength1, sideLength2, sideLength3);
//output (sideLength1, sideLength2, sideLength3);
cout << "\nAny more triangles to analyze? (y,n) ";
cin >> response;
}
while (response == 'Y' || response == 'y');
myLabel ("8.1", "2/11/2011");
return 0;
}
triangleShape shape
# include "header.h"
triangleType triangleShape(sideLenght1, sideLength2, sideLength3)
{
triangleType triangle;
return triangle;
}