Advertisements

Search results for extern

Example:[1]

            Write a program with two files ext1.c and ext2.c to demonstrate the use of extern keyword
          

            /* File ext1.c */
#include <stdio.h>
void call_fun();
int val2 = 90;
int main()
{
  call_fun();
  return 0;
}

/* File ext2.c */
#include <stdio.h>
extern int val2;
void call_fun()
{
  printf("The value of val2 is %d\n",val2);
}
          

 Search Links


 Popular C search MCQs


 Popular C search examples