Events and thoughts etc.

Create your own C Header file

See the following simple example to learn: (tested in gcc)
File 1: myLib.c
int sum(int a, int b)
{
      return a+b;
}
File 2: myLib.h
int sum(int, int);
File 3: testLib.c
#include<stdio.h>
#include"myLib.h"
int main()
{
      printf("%d\n",sum(10,20));
      return 0;
}
Commands to run:
gcc myLib.h myLib.c testLib.c
./a.out
Posted at 9/23/2010 07:50:00 PM 0 comments
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
Newer Posts Older Posts Home
Subscribe to: Posts (Atom)

Search This Blog

Pages

  • Home
  • Puzzles
  • Projects and Work
  • Jokes
  • Idioms
  • Enhance Vocabulary
  • Quotes
  • Movies Watched
  • Academics notes
  • Character Pictures
  • Hacking

My Links

  • ArtOrchid
  • CPP-Programs
  • Linode (register for VPS hosting)

Blog Archive

  • ►  2019 (1)
    • ►  05/26 - 06/02 (1)
  • ►  2018 (2)
    • ►  11/11 - 11/18 (2)
  • ►  2016 (5)
    • ►  09/25 - 10/02 (1)
    • ►  05/01 - 05/08 (1)
    • ►  01/24 - 01/31 (3)
  • ►  2011 (41)
    • ►  07/10 - 07/17 (2)
    • ►  07/03 - 07/10 (2)
    • ►  06/26 - 07/03 (11)
    • ►  06/19 - 06/26 (11)
    • ►  06/12 - 06/19 (15)
  • ▼  2010 (24)
    • ►  11/28 - 12/05 (1)
    • ►  10/03 - 10/10 (1)
    • ►  09/26 - 10/03 (1)
    • ▼  09/19 - 09/26 (1)
      • Create your own C Header file
    • ►  09/12 - 09/19 (1)
    • ►  08/22 - 08/29 (1)
    • ►  08/08 - 08/15 (4)
    • ►  07/11 - 07/18 (2)
    • ►  07/04 - 07/11 (1)
    • ►  06/06 - 06/13 (3)
    • ►  05/30 - 06/06 (4)
    • ►  05/09 - 05/16 (2)
    • ►  05/02 - 05/09 (1)
    • ►  04/18 - 04/25 (1)

About Me

monish001
View my complete profile
Monish Gupta. All rights reserved. Powered by Blogger.