What will it print? - C Structure

C examples for Structure:Structure Value

Description

What will it print?

Demo Code

#include <stdio.h> 
struct house { /*from w  ww.  j a  va2s .  c  om*/
   float sqft; 
   int rooms; 
   int stories; 
   char address[40]; 
}; 
int main(void) { 
   struct house my = {1234.0, 6, 1, "Main St."}; 
   struct house *sign; 
            
   sign = &my; 
   printf("%d %d\n", my.rooms, sign->stories); 
   printf("%s \n", my.address); 
   printf("%c %c\n", sign->address[3], my.address[4]); 
   return 0; 
}

Result


Related Tutorials