Mega Code Archive

 
Categories / C / Structure
 

Pass struct into a function

#include <stdio.h> struct struct_type {   int a, b;   char ch; } ; void f1(struct struct_type parm) {   printf("%d", parm.a); } int main(void) {   struct struct_type arg;   arg.a = 1000;   f1(arg);   return 0; }