Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- hello.h:
- #ifndef hello_h
- #define hello_h
- void hello(int i, double n);
- #endif
- hello.c:
- #include <stdio.h>
- #include "hw_hello.h"
- void hello(int i, double n) {
- printf("Hello, world !!! \n");
- const char *s = "Jak tekst";
- printf("I wynosi: %i n wymosi: %.2f tekst: %s\n",i,n,s);
- }
- main.c:
- #include"hw_hello.h"
- int main() {
- hello(11,13.03123);
- return 0;
- }
- WYWOLANIE W TERMINALU: gcc -o hello hello.c main.c hello.h
- makefile:
- .PHONY: clean
- all: hello
- hello: hw_main.o hw_hello.o
- gcc hw_main.o hw_hello.o -o hello
- hw_hello.o: hw_hello.c
- gcc -c hw_hello.c -o hw_hello.o
- hw_main.o: hw_main.c
- gcc -c hw_main.c -o hw_main.o
- clean:
- rm -f *.o *.a *.so hello
- WYWOLANIE W TERMINALU: make
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement