Skip to content

Instantly share code, notes, and snippets.

@atamis
Created March 30, 2009 02:36
Show Gist options
  • Save atamis/87606 to your computer and use it in GitHub Desktop.
Save atamis/87606 to your computer and use it in GitHub Desktop.
lib.c:
#include <stdio.h>
/*double sqrt(double)
double sqrt(double y)
{
int i;
double x=1;
for(i=0; i<12; i++)
{
x=(x+y/x)/2;
}
return x;
} */
int test(int i)
{
return i*2;
}
#include <stdio.h>
int main(void)
{
int number;
printf("Please enter number: ");
scanf(number);
printf(test(&number));
return 0;
}
main: main.o lib.o
gcc -o main main.o lib.o
main.o: main.c
gcc -c main.c
lib.o: lib.c
gcc -c lib.c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment