code wont run plz help structs
Hello everyone i'm new to the site and i've been reading through the tutorials on this site as a new programmer to C++. I'm in need of some help with structs.
I'm trying to make a program where it asks the user for the employee First initial, last initial, age, and ID. The ID will increment each time an employee is added.
Here is the code i have so far:
Code:
#include <iostream>
using namespace std;
struct database; {
char Finitial;
char Linitial;
int age;
int ID;
}
int main() {
database employee;
char YN;
int counter;
while (YN=='y') {
cout<<"Please enter your first Initial\n";
cin>>employee.Finitial;
cout<<"Please enter your last Initial\n";
cin>>employee.Linitial;
cout<<"Please enter your age\n";
cin>>employee.age;
employee.ID=counter;
counter=counter++;
cout<<"Would you like to enter a new employee\n";
cin>>YN;
}
cout<<employee.Finitial;
cout<<employee.Linitial;
cout<<employee.age;
cout<<employee.ID;
return 0;
}