-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Thitiwut Somsa
committed
Dec 18, 2021
1 parent
b387e02
commit a6d9260
Showing
11 changed files
with
112 additions
and
59 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Submodule c06
added at
759d6f
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include <stdio.h> | ||
|
||
char *ft_strdup(char *src); | ||
|
||
int main(void) | ||
{ | ||
char *s; | ||
|
||
printf("Expect.\n"); | ||
printf("Test text.bad.\n"); | ||
printf("Test text.\n"); | ||
printf("Result.\n"); | ||
s = ft_strdup("Test text.bad."); | ||
printf("%s\n",s); | ||
s[10] = 0; | ||
printf("%s\n",s); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include <stdio.h> | ||
|
||
int *ft_range(int min, int max); | ||
|
||
int main(void) | ||
{ | ||
int *a; | ||
int *b; | ||
|
||
a = ft_range(5,5); | ||
b = ft_range(5,9); | ||
printf("Expect.0x0 5 6 7 8\n"); | ||
printf("Result.%p %d %d %d %d\n",a,b[0],b[1],b[2],b[3]); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#include <stdio.h> | ||
|
||
int ft_ultimate_range(int **range, int min, int max); | ||
|
||
int main(void) | ||
{ | ||
int *a; | ||
int *b; | ||
int c; | ||
int d; | ||
|
||
c = ft_ultimate_range(&a,5,5); | ||
d = ft_ultimate_range(&b,5,9); | ||
printf("Expect.0 4 0x0 5 6 7 8\n"); | ||
printf("Result.%d %d %p %d %d %d %d\n",c,d,a,b[0],b[1],b[2],b[3]); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
char *ft_strjoin(int size, char **strs, char *sep); | ||
|
||
int main(int argc, char **argv) | ||
{ | ||
char *strs[10]; | ||
char *str; | ||
int i; | ||
|
||
strs[0] = "abc"; | ||
strs[1] = "def"; | ||
strs[2] = ""; | ||
strs[3] = "m"; | ||
strs[4] = "badfsfsaf"; | ||
|
||
i = 3; | ||
if (argc>1) | ||
{ | ||
i = argv[1][0] - '0'; | ||
} | ||
|
||
str = ft_strjoin(i,strs, " x "); | ||
printf("%s\n",str); | ||
free(str); | ||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#include <stdio.h> | ||
|
||
char *ft_convert_base(char *nbr, char *base_from, char *base_to); | ||
|
||
int main(void) | ||
{ | ||
char *str; | ||
|
||
str = ft_convert_base("5647","0123456789","0123456789ABCDEF"); | ||
printf("%s\n",str); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#include <stdio.h> | ||
|
||
char **ft_split(char *str, char *charset); | ||
|
||
int main(void) | ||
{ | ||
char **strs; | ||
|
||
strs = ft_split("fsasfadsfsdfsbcxbcxbcxbbb", "abc"); | ||
|
||
int i=0; | ||
while (strs[i]) | ||
printf("%s\n",strs[i++]); | ||
return (0); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
if [ -f "a.out" ] ; then | ||
rm a.out | ||
fi | ||
Norminette -R CheckForbiddenSourceHeader $1 $2 | ||
gcc -Wall -Wextra -Werror $1 $2 main.c | ||
./a.out | cat -e | ||
|