#include <stdio.h> struct { int watts; int lumens; } bulbA; int main(int argc, char *argv[]) { /* set values for bulbA */ bulbA.watts = 100; bulbA.lumens = 1710; /* print values of bulbA */ printf("BulbA: watts = %d\tlumens = %d\n", bulbA.watts, bulbA.lumens ); system("PAUSE"); return 0; }
Comments: The following is incorrect syntax:
struct { int watts = 100; /* wrong */ int lumens = 1710; /* wrong */ } bulbA;