Write a program to show how to use structure which does not have a name.
#include<stdio.h> struct { int a; char ch; float f; }v1 = {5,'A',2.4},v2 = {.ch = 'B'}; int main() { printf("%d %c %f\n",v1.a,v1.ch,v1.f); printf("%d %c %f\n",v2.a,v2.ch,v2.f); return 0; }
Output
5 A 2.400000 0 B 0.000000