I am getting two error messages here and don't know why or how to solve.
First error message is warning C4091: '' : ignored on left of 'void' when no variable is declared based off of line 23. The second error is error C3861: 'ReadEmployee': identifier not found from line 30. I have looked up the error messages online and still don't understand. Below is the code;
#include<iostream>
#include<conio.h>
#include<cstdlib>
#include<stdio.h>
usingnamespace std;
//function prototype
void;
//Define the main entry point for the console app
int main(void)
{
// call function
ReadEmployee();
getch();
return 0;
}
// class Account definition
class Account
{
public:
int acc_no;
float balance;
};
// class Employee definition
class Employee
{
public:
// makes pointer of Account class
Account*a;
char designation[50];
char name[50];
float salary;
public:
// default constructor
Employee()
{
a=new Account;
}
// declare and define the function
void Format(char Buffer[], int buffer_length)
{
strncpy(Buffer, this->name, buffer_length);
char arr[50];
sprintf(arr,"%f",this->salary);
// concatenate the salary with name in the buffer
strncat(Buffer,arr,buffer_length-strlen(this->name));
}
};
// fucntion to read employee details and formats and displays employee
void ReadEmployee()
{
// create an object of employee class
Employee e1;
int static_AccNo=1000;
cout <<"Enter Employee Details";
// loop for entering employee details using object of Employee
for(int i=0;i<1;i++)
{
cout<<"Enployee Name::";
cin>>e1.name;
cout<<"Employee designation::";
cin>>e1.designation;
cout<<"Employee Salary::";
cin>>e1.salary;
// create a pointer of Account class.
// points to value of static_AccNo (1000)
Account*ea=new Account;
// auto increment the account number every time by one
// store it in acc_no as pointed by ea
ea->acc_no=static_AccNo++;
// calculate the monthly salary and store in balance
ea->balance=e1.salary/12;
// assign the value of ea to object of Account class
e1.a=ea;
// declare array of character data type to store the value of result
char buffer[100];
buffer[0]='\0';
// displays the formatte employee detail
e1.Format(buffer,100);
cout<<buffer;
}
}