changed code removed main from each file
This commit is contained in:
		
							
								
								
									
										12
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								Makefile
									
									
									
									
									
								
							@@ -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)
 | 
				
			||||||
@@ -1,6 +1,6 @@
 | 
				
			|||||||
#include <stdio.h>
 | 
					#include <stdio.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int main()
 | 
					int my_float()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  float f;
 | 
					  float f;
 | 
				
			||||||
  double d;
 | 
					  double d;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -6,9 +6,3 @@ int foo()
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  return 0;
 | 
					  return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					 | 
				
			||||||
int main()
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
  foo();
 | 
					 | 
				
			||||||
  return 0;
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -3,7 +3,7 @@
 | 
				
			|||||||
int hex_scan()
 | 
					int hex_scan()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  int a, b;
 | 
					  int a;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  printf("Enter a number : ");
 | 
					  printf("Enter a number : ");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -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;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,6 @@
 | 
				
			|||||||
#include <stdio.h>
 | 
					#include <stdio.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int main()
 | 
					int print_with_scan()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  int a , b ;
 | 
					  int a , b ;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,6 @@
 | 
				
			|||||||
#include <stdio.h>
 | 
					#include <stdio.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int main()
 | 
					int my_scan()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  int a;
 | 
					  int a;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,6 @@
 | 
				
			|||||||
#include <stdio.h>
 | 
					#include <stdio.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int main()
 | 
					int scan_two_numbers()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  int a, b;
 | 
					  int a, b;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,6 +1,6 @@
 | 
				
			|||||||
#include <stdio.h>
 | 
					#include <stdio.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int main()
 | 
					int addition()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  int a , b , c;
 | 
					  int a , b , c;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user