From 5da6169459c2a6fd7a44b4a7207c38e7cf0d252b Mon Sep 17 00:00:00 2001 From: Reynald LECHAPT Date: Tue, 10 Mar 2015 06:56:49 +0100 Subject: [PATCH] coucou --- Makefile | 49 ++++++++++ auteur | 1 + ft_bzero.s | 20 ++++ ft_cat.s | 28 ++++++ ft_isalnum.s | 22 +++++ ft_isalpha.s | 23 +++++ ft_isascii.s | 19 ++++ ft_isdigit.s | 19 ++++ ft_islower.s | 20 ++++ ft_isprint.s | 19 ++++ ft_isupper.s | 20 ++++ ft_memcpy.s | 8 ++ ft_memset.s | 10 ++ ft_puts.s | 53 +++++++++++ ft_strcat.s | 25 +++++ ft_strdup.s | 22 +++++ ft_strlen.s | 17 ++++ ft_tolower.s | 19 ++++ ft_toupper.s | 19 ++++ libfts.h | 42 +++++++++ main.c | 261 +++++++++++++++++++++++++++++++++++++++++++++++++++ 21 files changed, 716 insertions(+) create mode 100644 Makefile create mode 100644 auteur create mode 100644 ft_bzero.s create mode 100644 ft_cat.s create mode 100644 ft_isalnum.s create mode 100644 ft_isalpha.s create mode 100644 ft_isascii.s create mode 100644 ft_isdigit.s create mode 100644 ft_islower.s create mode 100644 ft_isprint.s create mode 100644 ft_isupper.s create mode 100644 ft_memcpy.s create mode 100644 ft_memset.s create mode 100644 ft_puts.s create mode 100644 ft_strcat.s create mode 100644 ft_strdup.s create mode 100644 ft_strlen.s create mode 100644 ft_tolower.s create mode 100644 ft_toupper.s create mode 100644 libfts.h create mode 100644 main.c diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..cd7a14f --- /dev/null +++ b/Makefile @@ -0,0 +1,49 @@ +# **************************************************************************** # +# # +# ::: :::::::: # +# Makefile :+: :+: :+: # +# +:+ +:+ +:+ # +# By: rlechapt +#+ +:+ +#+ # +# +#+#+#+#+#+ +#+ # +# Created: 2015/03/08 15:15:46 by rlechapt #+# #+# # +# Updated: 2015/03/10 06:24:32 by rlechapt ### ########.fr # +# # +# **************************************************************************** # + +SRC = ft_islower.s \ + ft_isupper.s \ + ft_toupper.s \ + ft_tolower.s \ + ft_isdigit.s \ + ft_isprint.s \ + ft_isascii.s \ + ft_isalnum.s \ + ft_isalpha.s \ + ft_strlen.s \ + ft_puts.s \ + ft_strcat.s \ + ft_bzero.s \ + ft_memset.s \ + ft_memcpy.s \ + ft_strdup.s \ + ft_cat.s + +OBJ = $(SRC:%.s=%.o) +NAME = libfts.a + +all: $(NAME) + +$(NAME): $(OBJ) + ar rc $(NAME) $(OBJ) + ranlib $(NAME) + +%.o: %.s libfts.h + nasm -f macho64 $< + +clean: + rm -f $(OBJ) + +fclean: clean + rm -f $(NAME) + +re: fclean all diff --git a/auteur b/auteur new file mode 100644 index 0000000..566ab64 --- /dev/null +++ b/auteur @@ -0,0 +1 @@ +rlechapt diff --git a/ft_bzero.s b/ft_bzero.s new file mode 100644 index 0000000..f0742f3 --- /dev/null +++ b/ft_bzero.s @@ -0,0 +1,20 @@ +segment .text + global _ft_bzero + +_ft_bzero: + cmp rdi,0 + je end + mov rbx,rdi + xor rcx,rcx + jmp loop + +loop: + cmp rsi,rcx + je end + mov byte [rbx],0 + inc rbx + inc rcx + jmp loop + +end: + ret diff --git a/ft_cat.s b/ft_cat.s new file mode 100644 index 0000000..ee137c7 --- /dev/null +++ b/ft_cat.s @@ -0,0 +1,28 @@ + +%define BUFF_SIZE 1 +%define SYSCALL(n) 0x2000000 | n + +section .bss + buffer resb BUFF_SIZE + +section .text + global _ft_cat + +_ft_cat: + push rdi + mov rsi, buffer + mov rdx, BUFF_SIZE + mov rax, SYSCALL(3) ; read + syscall + jc end + cmp rax, 0 + je end + mov rdi, 1 + mov rdx, rax + mov rax, SYSCALL(4) ; write + syscall + pop rdi + jmp _ft_cat + +end: + ret diff --git a/ft_isalnum.s b/ft_isalnum.s new file mode 100644 index 0000000..682e141 --- /dev/null +++ b/ft_isalnum.s @@ -0,0 +1,22 @@ +segment .text + global _ft_isalnum + extern _ft_isalpha + extern _ft_isdigit + +_ft_isalnum: + call _ft_isalpha + cmp rax,1 + je true + call _ft_isdigit + cmp rax,1 + je true + +false: + jmp done + +true: + mov rax,1 + jmp done + +done: + ret diff --git a/ft_isalpha.s b/ft_isalpha.s new file mode 100644 index 0000000..7fca30e --- /dev/null +++ b/ft_isalpha.s @@ -0,0 +1,23 @@ +segment .text + global _ft_isalpha + extern _ft_islower + extern _ft_isupper + +_ft_isalpha: + call _ft_islower + cmp rax, 1 + je true + call _ft_isupper + cmp rax, 1 + je true + +false: + mov rax, 0 + jmp done + +true: + mov rax, 1 + jmp done + +done: + ret diff --git a/ft_isascii.s b/ft_isascii.s new file mode 100644 index 0000000..c4c79f2 --- /dev/null +++ b/ft_isascii.s @@ -0,0 +1,19 @@ +segment .text + global _ft_isascii + +_ft_isascii: + cmp rdi, 0 + jl false + cmp rdi, 127 + jg false + +true: + mov rax,1 + jmp done + +false: + mov rax,0 + jmp done + +done: + ret diff --git a/ft_isdigit.s b/ft_isdigit.s new file mode 100644 index 0000000..47d8dba --- /dev/null +++ b/ft_isdigit.s @@ -0,0 +1,19 @@ +segment .text + global _ft_isdigit + +_ft_isdigit: + cmp rdi,48 + jl false + cmp rdi,57 + jg false + +true: + mov rax,1 + jmp done + +false: + mov rax,0 + jmp done + +done: + ret diff --git a/ft_islower.s b/ft_islower.s new file mode 100644 index 0000000..3e9aba1 --- /dev/null +++ b/ft_islower.s @@ -0,0 +1,20 @@ +segment .text + global _ft_islower + + _ft_islower: + cmp rdi,97 + jl false + cmp rdi,122 + jg false + jmp true + + false: + mov rax,0 + jmp done + + true: + mov rax,1 + jmp done + + done: + ret diff --git a/ft_isprint.s b/ft_isprint.s new file mode 100644 index 0000000..4c191a7 --- /dev/null +++ b/ft_isprint.s @@ -0,0 +1,19 @@ +segment .text + global _ft_isprint + +_ft_isprint: + cmp rdi, 32 + jl false + cmp rdi, 126 + jg false + +true: + mov rax,1 + jmp done + +false: + mov rax,0 + jmp done + +done: + ret diff --git a/ft_isupper.s b/ft_isupper.s new file mode 100644 index 0000000..b46dadb --- /dev/null +++ b/ft_isupper.s @@ -0,0 +1,20 @@ +segment .text + global _ft_isupper + +_ft_isupper: + cmp rdi, 65 + jl false + cmp rdi, 90 + jg false + jmp true + +true: + mov rax, 1 + jmp done + +false: + mov rax, 0 + jmp done + +done: + ret diff --git a/ft_memcpy.s b/ft_memcpy.s new file mode 100644 index 0000000..4e06d78 --- /dev/null +++ b/ft_memcpy.s @@ -0,0 +1,8 @@ +segment .text + global _ft_memcpy + +_ft_memcpy: + mov rax, rdi + mov rcx, rdx + rep movsb + ret diff --git a/ft_memset.s b/ft_memset.s new file mode 100644 index 0000000..2693165 --- /dev/null +++ b/ft_memset.s @@ -0,0 +1,10 @@ +segment .text + global _ft_memset + +_ft_memset: + mov rcx, rdx + mov rax, rsi + mov rbx, rdi + rep stosb + mov rax, rbx + ret diff --git a/ft_puts.s b/ft_puts.s new file mode 100644 index 0000000..f852816 --- /dev/null +++ b/ft_puts.s @@ -0,0 +1,53 @@ +%define SYSCALL(n) 0x2000000 | n + +section .data + break db 10 + null db "(null)", 0 + +section .text + global _ft_puts + +_ft_puts: + push rbp + mov rbp, rsp + cmp rdi, 0 + jle exit + cmp rdi, 0 + jne suite + mov rdi, null + +suite: + push rdx + push rbx + push rsi + mov rbx, rdi + +loop: + cmp byte [rbx], 0 + je end + mov rdi, 1 + mov rsi, rbx + mov rdx, 1 + mov rax, SYSCALL(4) + syscall + inc rbx + jmp loop + +end: + pop rsi + pop rbx + pop rdx + mov rax, 1 + mov rax, SYSCALL(4) + mov rdi, 1 + mov rsi, break + mov rdx, 1 + syscall + leave + ret + +exit: + mov rax, 0 + mov rsp, rbp + pop rbp + ret diff --git a/ft_strcat.s b/ft_strcat.s new file mode 100644 index 0000000..a235a34 --- /dev/null +++ b/ft_strcat.s @@ -0,0 +1,25 @@ +section .text +global _ft_strcat + +_ft_strcat: + mov rbx, rdi + mov rcx, rsi + +loop1: + cmp byte [rbx], 0 + je loop2 + inc rbx + jmp loop1 + +loop2: + cmp byte [rcx], 0 + je end + mov al, byte [rcx] + mov byte [rbx], al + inc rcx + inc rbx + jmp loop2 + +end: + mov rax, rdi + ret diff --git a/ft_strdup.s b/ft_strdup.s new file mode 100644 index 0000000..06ac3bd --- /dev/null +++ b/ft_strdup.s @@ -0,0 +1,22 @@ +segment .text + global _ft_strdup + extern _malloc + extern _ft_memcpy + extern _ft_strlen + +_ft_strdup: + mov rbx, rdi + call _ft_strlen + mov rdi, rax + add rdi, 1 + push rdi + call _malloc + cmp rax, 0 + je end + mov rdi, rax + mov rsi, rbx + pop rdx + call _ft_memcpy + +end: + ret diff --git a/ft_strlen.s b/ft_strlen.s new file mode 100644 index 0000000..b138967 --- /dev/null +++ b/ft_strlen.s @@ -0,0 +1,17 @@ +segment .text + global _ft_strlen + +_ft_strlen: + cmp rdi,0 + je null + mov al,0 + mov rcx,-1 + repne scasb + not rcx + sub rcx,1 + mov rax, rcx + ret + +null: + mov rax,0 + ret diff --git a/ft_tolower.s b/ft_tolower.s new file mode 100644 index 0000000..6cc9e29 --- /dev/null +++ b/ft_tolower.s @@ -0,0 +1,19 @@ +segment .text + global _ft_tolower + +_ft_tolower: + mov rax,rdi + cmp rdi, 65 + jl false + cmp rdi, 90 + jg false + +true: + add rax, 32 + jmp done + +false: + jmp done + +done: + ret diff --git a/ft_toupper.s b/ft_toupper.s new file mode 100644 index 0000000..15b1a19 --- /dev/null +++ b/ft_toupper.s @@ -0,0 +1,19 @@ +segment .text + global _ft_toupper + +_ft_toupper: + mov rax,rdi + cmp rdi,97 + jl false + cmp rdi, 122 + jg false + +true: + sub rax,32 + jmp done + +false: + jmp done + +done: + ret diff --git a/libfts.h b/libfts.h new file mode 100644 index 0000000..21e1222 --- /dev/null +++ b/libfts.h @@ -0,0 +1,42 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* libfts.h :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: rlechapt +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2015/03/08 18:20:44 by rlechapt #+# #+# */ +/* Updated: 2015/03/10 06:23:22 by rlechapt ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#ifndef LIBFTS_H +# define LIBFTS_H + +# include + +void ft_bzero(void *s, size_t n); +char *ft_strcat(char *s1, const char *s2); +int ft_islower(int c); +int ft_isupper(int c); +int ft_isalpha(int c); +int ft_isdigit(int c); +int ft_isalnum(int c); +int ft_isascii(int c); +int ft_isprint(int c); +int ft_toupper(int c); +int ft_tolower(int c); +int ft_puts(char *str); +size_t ft_strlen(const char *str); +void *ft_memset(void *b, int c, size_t len); +void *ft_memcpy(void *dst, const void *src, size_t n); +char *ft_strdup(const char *s1); +void ft_cat(int fd); +/*void ft_exit(int ret); +void ft_filezero(char *file); +void ft_log(char *file); +void *ft_memalloc(size_t n); +void ft_nebre(void); +char *ft_strcpy(char *dst, char *src);*/ + +#endif diff --git a/main.c b/main.c new file mode 100644 index 0000000..29dc2df --- /dev/null +++ b/main.c @@ -0,0 +1,261 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* main.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: rlechapt +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2015/03/08 18:23:08 by rlechapt #+# #+# */ +/* Updated: 2015/03/10 06:49:35 by rlechapt ### ########.fr */ +/* */ +/* ************************************************************************** */ + +#include "libfts.h" +#include +#include +#include + +void check_alnum(void) +{ + printf("[-] ALNUM [-]\n"); + printf("[+] Test on %c, return = %d [+]\n", 'a', ft_isalnum('a')); + printf("[+] Test on %c, return = %d [+]\n", 'z', ft_isalnum('z')); + printf("[+] Test on %c, return = %d [+]\n", '*', ft_isalnum('*')); + printf("[+] Test on %c, return = %d [+]\n", 'Z', ft_isalnum('Z')); + printf("[+] Test on %c, return = %d [+]\n", 'A', ft_isalnum('A')); + printf("[+] Test on %c, return = %d [+]\n", '0', ft_isalnum('0')); + printf("[+] Test on %c, return = %d [+]\n", '9', ft_isalnum('9')); + printf("[+] Test on %c, return = %d [+]\n", '4', ft_isalnum('4')); + printf("[-] Test with NULL [-]\n"); + printf("[+] Test return = %d [+]\n", ft_isalnum(0)); + printf("[-] END OF ALNUM [-]\n"); +} + +void check_digit(void) +{ + printf("[-] DIGIT [-]\n"); + printf("[+] Test on %c, return = %d [+]\n", 'a', ft_isdigit('a')); + printf("[+] Test on %c, return = %d [+]\n", 'z', ft_isdigit('z')); + printf("[+] Test on %c, return = %d [+]\n", '*', ft_isdigit('*')); + printf("[+] Test on %c, return = %d [+]\n", 'Z', ft_isdigit('Z')); + printf("[+] Test on %c, return = %d [+]\n", 'A', ft_isdigit('A')); + printf("[+] Test on %c, return = %d [+]\n", '0', ft_isdigit('0')); + printf("[+] Test on %c, return = %d [+]\n", '9', ft_isdigit('9')); + printf("[+] Test on %c, return = %d [+]\n", '4', ft_isdigit('4')); + printf("[-] Test with NULL [-]\n"); + printf("[+] Test return = %d [+]\n", ft_isdigit(0)); + printf("[-] END OF DIGIT [-]\n"); +} + +void check_alpha(void) +{ + printf("[-] ALPHA [-]\n"); + printf("[+] Test on %c, return = %d [+]\n", 'a', ft_isalpha('a')); + printf("[+] Test on %c, return = %d [+]\n", 'z', ft_isalpha('z')); + printf("[+] Test on %c, return = %d [+]\n", '*', ft_isalpha('*')); + printf("[+] Test on %c, return = %d [+]\n", 'Z', ft_isalpha('Z')); + printf("[+] Test on %c, return = %d [+]\n", 'A', ft_isalpha('A')); + printf("[+] Test on %c, return = %d [+]\n", '0', ft_isalpha('0')); + printf("[+] Test on %c, return = %d [+]\n", '9', ft_isalpha('9')); + printf("[+] Test on %c, return = %d [+]\n", '4', ft_isalpha('4')); + printf("[-] Test with NULL [-]\n"); + printf("[+] Test return = %d [+]\n", ft_isalpha(0)); + printf("[-] END OF ALPHA [-]\n"); +} + +void check_tolower(void) +{ + printf("[-] TOLOWER [-]\n"); + printf("[+] Test on %c, return = %c [+]\n", 'a', ft_tolower('a')); + printf("[+] Test on %c, return = %c [+]\n", 'z', ft_tolower('z')); + printf("[+] Test on %c, return = %c [+]\n", '*', ft_tolower('*')); + printf("[+] Test on %c, return = %c [+]\n", 'Z', ft_tolower('Z')); + printf("[+] Test on %c, return = %c [+]\n", 'A', ft_tolower('A')); + printf("[+] Test on %c, return = %c [+]\n", '0', ft_tolower('0')); + printf("[+] Test on %c, return = %c [+]\n", '9', ft_tolower('9')); + printf("[+] Test on %c, return = %c [+]\n", '4', ft_tolower('4')); + printf("[-] Test with NULL [-]\n"); + printf("[+] Test return = %c [+]\n", ft_tolower(0)); + printf("[-] END OF TOLOWER [-]\n"); +} + +void check_toupper(void) +{ + printf("[-] TOUPPER [-]\n"); + printf("[+] Test on %c, return = %c [+]\n", 'a', ft_toupper('a')); + printf("[+] Test on %c, return = %c [+]\n", 'z', ft_toupper('z')); + printf("[+] Test on %c, return = %c [+]\n", '*', ft_toupper('*')); + printf("[+] Test on %c, return = %c [+]\n", 'Z', ft_toupper('Z')); + printf("[+] Test on %c, return = %c [+]\n", 'A', ft_toupper('A')); + printf("[+] Test on %c, return = %c [+]\n", '0', ft_toupper('0')); + printf("[+] Test on %c, return = %c [+]\n", '9', ft_toupper('9')); + printf("[+] Test on %c, return = %c [+]\n", '4', ft_toupper('4')); + printf("[-] Test with NULL [-]\n"); + printf("[+] Test return = %c [+]\n", ft_toupper(0)); + printf("[-] END OF TOUPPER [-]\n"); +} + +void check_isascii(void) +{ + printf("[-] ISASCII [-]\n"); + printf("[+] Test on %c : %d, return = %d [+]\n", 'a', 'a', ft_isascii('a')); + printf("[+] Test on %c : %d, return = %d [+]\n", 'z', 'z', ft_isascii('z')); + printf("[+] Test on %c : %d, return = %d [+]\n", 'A', 'A', ft_isascii('A')); + printf("[+] Test on %c : %d, return = %d [+]\n", 'Z', 'Z', ft_isascii('Z')); + printf("[+] Test on %c : %d, return = %d [+]\n", 245, 245, ft_isascii(245)); + printf("[+] Test on %c : %d, return = %d [+]\n", 221, 221, ft_isascii(221)); + printf("[-] Test with NULL [-]\n"); + printf("[+] Test return = %d [+]\n", ft_isascii(0)); + printf("[-] END OF ISASCII [-]\n"); +} + +void check_strlen(void) +{ + char str[5] = "abcd"; + char str2[3] = "op"; + + printf("[+] STRLEN [+]\n"); + printf("[-] %s, sized: %d [-]\n", str, (int)ft_strlen(str)); + printf("[-] %s, sized: %d [-]\n", str2, (int)ft_strlen(str2)); + + printf("[-] Test with NULL [-]\n"); + printf("[-] sized: %d [-]\n", (int)ft_strlen(0)); + printf("[+] END OF STRLEN [+]\n"); +} + +void check_puts(void) +{ + printf("[+] PUTS [+]\n"); + ft_puts("[-] a [-]"); + ft_puts("[-] $#@#',./,~!@~=+ [-]"); + printf("[+] Test with null [+]\n"); + ft_puts(NULL); + printf("[+] END OF PUTS [+]\n"); +} + +void check_strcat(void) +{ + char str[5]; + + str[0] = '\0'; + printf("[+] STRCAT [+]\n"); + printf("[-] Str init with empy char : %s [-]\n", ft_strcat(str, "")); + printf("[-] Str: %s [-]\n", ft_strcat(str, "h")); + printf("[-] Str: %s [-]\n", ft_strcat(str, "ello")); + printf("[-] Str: %s [-]\n", ft_strcat(str, "!")); + printf("[+] END OF STRCAT [+]\n"); +} + +void check_bzero(void) +{ + char str[4] = "jui"; + + printf("[-] BZERO [-]\n"); + printf("[+] str[0] = %d = %c [+]\n", str[0], str[0]); + printf("[+] str[1] = %d = %c [+]\n", str[1], str[1]); + printf("[+] str[2] = %d = %c [+]\n", str[2], str[2]); + printf("[-] FT_BZERO DONE [-]\n"); + ft_bzero(str, 3); + printf("[+] str[0] = %d = %c [+]\n", str[0], str[0]); + printf("[+] str[1] = %d = %c [+]\n", str[1], str[1]); + printf("[+] str[2] = %d = %c [+]\n", str[2], str[2]); + printf("[-] Test with NULL [-]\n"); + ft_bzero(NULL, 0); + printf("[-] END OF BZERO [-]\n"); +} + +void check_memset(void) +{ + printf("[+] MEMSET [+]\n"); + printf("[-] Befor memset: %s [-]\n", "abcd"); + printf("[-] After memset: %s [-]\n", (char*)ft_memset(ft_strdup("abcd"), + 'A', 3)); + printf("[+] END OF MEMSET [+]\n"); +} + +void check_memcpy(void) +{ + char str[2]; + char str2[6]; + + ft_bzero(str, 2); + ft_bzero(str2, 6); + + printf("[+] MEMCPY [+]\n"); + printf("[-] Str1 size: %d, Content: %s [-]\n", (int)ft_strlen(str), str); + printf("[-] Str2 size: %d, Content: %s [-]\n", (int)ft_strlen(str2), str2); + ft_memcpy((void*)str, (void*)"a", 1); + ft_memcpy((void*)str2, (void*)"hello", 5); + printf("[+] Using ft_memcpy [+]\n"); + printf("[-] Str1 size: %d, Content: %s [-]\n", (int)ft_strlen(str), str); + printf("[-] Str2 size: %d, Content: %s [-]\n", (int)ft_strlen(str2), str2); + printf("[+] END OF MEMCPY [+]\n"); +} + +void check_strdup(void) +{ + char *str; + char f[] = "h"; + char s[] = "hello"; + char t[] = ""; + + printf("[+] STRDUP [+]\n"); + printf("[-] Str init [-]\n"); + str = ft_strdup(f); + printf("[-] Str after strdup (\"%s\") %d [-]\n", str, (int)ft_strlen(str)); + str = ft_strdup(s); + printf("[-] Str after strdup (\"%s\") %d [-]\n", str, (int)ft_strlen(str)); + str = ft_strdup(t); + printf("[-] Str after strdup (\"%s\") %d [-]\n", str, (int)ft_strlen(str)); + printf("[+] END OF STRDUP [+]\n"); +} + +void check_cat(void) +{ + int i; + + i = open("ft_cat.s", O_RDONLY); + printf("[+] CAT [+]\n"); + printf("[-] File for cat : ft_cat.s\n"); + printf("[-] Cat for file : \n"); + ft_cat(i); + close(i); +// printf("\n[+] END OF CAT [+]\n"); +} + +int main(void) +{ + // ft_nebre(); + check_digit(); + printf("\n"); + check_alpha(); + printf("\n"); + check_alnum(); + printf("\n"); + check_tolower(); + printf("\n"); + check_toupper(); + printf("\n"); + check_puts(); + printf("\n"); + check_isascii(); + printf("\n"); + check_bzero(); + printf("\n"); + // check_memalloc(); + // printf("\n"); + check_strlen(); + printf("\n"); + check_strdup(); + printf("\n"); + check_memset(); + printf("\n"); + check_memcpy(); + printf("\n"); + check_strcat(); + printf("\n"); + check_cat(); + /* check_b(); + printf("\n");*/ + return 0; +}