struct josiah{
float hez;
int asa;
char flah[8];
};
int main (void){
struct josiah josh = {2.141, 22, "king"};
Q1: what is the effect of the code cout<< ++joash.asa.+joash.hez;?
A1: ++joash.asa = 22+1 = 23, joash.hez = 3.14, so cout<< ++joash.asa.+joash.hez; will display 26.141.
The professor grade me and say "what else?" i don't know what else is there. Can anyone help me on that.
Q2: if i were to add a substructure of type jehoram name joram to this structure, how would i access the member initial of the sub structure and set it equal to 'A'
A:
1 2 3 4 5 6
struct jehoram{
char initial {2};
};
int main (void){
struct jehoram joram = {'A'};
return 0;
For that answer the professor mark me completely wrong, which i don't know why.