#include<iostream>
usingnamespace std;
struct person{
char name[20];
char gender;
char adress[30];
int day;
int month;
int year;
}
int main(){
person friend={"Mark", 'M', "NY Street 47", 23, 7, 1979};
person* pointer=&friend;
// cout:
cout<<"Name os the person: "<<friend.name<<endl;
cout<<"Gender of the person: "<<((friend.gender=='M')?"male":"female")<<endl;
cout<<"Adressof the person: "<<friend.adress<<endl;
//cout<<"pointer is: "<<pointer<<endl;
cout<<"Name of the person is: "<<(*pointer).name<<endl;
cout<<"Name of the person: "<<pointer->name<<endl;
cout<<"Adress of the person: "<<(*pointer).adress<<endl;
cout<<"Adress of the person: "<<pointer->adress<<endl;
return 0;
}
1 2 3 4 5
Line 14: error: new types may not be defined in a return type