I was practicing my object orianted programming when I had this error:
expected primary-expression before "void"
expected `;' before "void"
Any help would be appreciated. Here is the source code:
-------------------------------------------------------------------------------
#include <iostream>
using namespace std;
class pet
{
int pet_ID;
int number;
public:
pet()
{
cout <<"Now in the constructor\n" << endl;
void petID(void)
{
if(int number = 0; number < 5; number++;)
{
break;
}
pet_ID = number;
}
}
int get_petID(void);
};
int pet::get_petID(void)
{
return pet_ID;
}
int main()
{
pet dog;
cout <<"Accessing dog's data" << endl;
cout <<"------------------------------\n" << endl;
cout <<"The dog's ID is: " << dog.get_petID();
cout <<"\n" << endl;