first commit!

This commit is contained in:
2025-02-06 12:54:34 +02:00
commit 37f9a3d138
24 changed files with 693 additions and 0 deletions

21
typeconversions.c Normal file
View File

@ -0,0 +1,21 @@
#include <ctype.h>
#include <stdio.h>
int atoi(char s[]);
int main() {
printf("%d\n", atoi("234"));
}
int atoi(char string[]) {
int n = 0;
/*
* v1
for (int i = 0; string[i] >= '0' && string[i] <= '9'; ++i)
n = 10 * n + (string[i] - '0');
*/
for (int i = 0; isdigit(string[i]); ++i)
n = 10 * n + (string[i] - '0');
return n;
}