changed code removed main from each file

This commit is contained in:
Mert Gör 🇹🇷 2025-04-12 22:53:01 +03:00
parent 9a2eabf5cf
commit 97d77a3ff6
Signed by: hwpplayer1
GPG Key ID: 03E547D043AB6C8F
11 changed files with 19 additions and 23 deletions

View File

@ -2,16 +2,12 @@ CC = gcc
CFLAGS = -Wall -Wextra -std=c11 CFLAGS = -Wall -Wextra -std=c11
SRCDIR = ./c-basic SRCDIR = ./c-basic
SRC = $(wildcard $(SRCDIR)/*.c) SRC = $(wildcard $(SRCDIR)/*.c)
OBJ = $(SRC:.c=.o) OBJ = $(patsubst $(SRCDIR)/%.c, $(SRCDIR)/%.o, $(SRC))
TARGET = main TARGET = main
all: $(TARGET) all: $(TARGET)
$(TARGET): $(OBJ) $(TARGET): $(OBJ)
$(CC) $(CFLAGS) -o $@ $^ $(CC) $(CFLAGS) -o $@ $^
$(SRCDIR)/%.o: $(SRCDIR)/%.c $(SRCDIR)/%.o: $(SRCDIR)/%.c
$(CC) $(CFLAGS) -c $< -o $@ $(CC) $(CFLAGS) -c $< -o $@
clean: clean:
rm -f $(OBJ) $(TARGET) rm -f $(OBJ) $(TARGET)

View File

@ -1,6 +1,6 @@
#include <stdio.h> #include <stdio.h>
int main() int my_float()
{ {
float f; float f;
double d; double d;

View File

@ -6,9 +6,3 @@ int foo()
return 0; return 0;
} }
int main()
{
foo();
return 0;
}

View File

@ -1,6 +1,6 @@
#include <stdio.h> #include <stdio.h>
int main() int hello()
{ {
printf("Hello C Programming Language 2025 Examples"); printf("Hello C Programming Language 2025 Examples");

View File

@ -3,7 +3,7 @@
int hex_scan() int hex_scan()
{ {
int a, b; int a;
printf("Enter a number : "); printf("Enter a number : ");

View File

@ -1,5 +1,11 @@
#include <stdio.h> #include <stdio.h>
#include "hex_read_scanf.c"
#ifndef HEX_READ_SCANF_H
#define HEX_READ_SCANF_H
extern void hex_scan();
#endif // HEX_READ_SCANF_H
int main() int main()
{ {

View File

@ -1,6 +1,6 @@
#include <stdio.h> #include <stdio.h>
int main() int print_example()
{ {
int a = 10, b = 20; int a = 10, b = 20;

View File

@ -1,6 +1,6 @@
#include <stdio.h> #include <stdio.h>
int main() int print_with_scan()
{ {
int a , b ; int a , b ;

View File

@ -1,6 +1,6 @@
#include <stdio.h> #include <stdio.h>
int main() int my_scan()
{ {
int a; int a;

View File

@ -1,6 +1,6 @@
#include <stdio.h> #include <stdio.h>
int main() int scan_two_numbers()
{ {
int a, b; int a, b;

View File

@ -1,6 +1,6 @@
#include <stdio.h> #include <stdio.h>
int main() int addition()
{ {
int a , b , c; int a , b , c;