22 lines
357 B
Plaintext
22 lines
357 B
Plaintext
|
#include <stdio.h>
|
||
|
#include <string.h>
|
||
|
size_t my_strlen(const char *str) {
|
||
|
size_t len = 0;
|
||
|
while (*str++) {
|
||
|
len++;
|
||
|
}
|
||
|
return len;
|
||
|
}
|
||
|
|
||
|
int main() {
|
||
|
const char *test_string = "Hello, world!";
|
||
|
size_t length = my_strlen(test_string);
|
||
|
|
||
|
|
||
|
char source[] = "Fabian";
|
||
|
char destination[100];
|
||
|
strcpy(destination, source);
|
||
|
|
||
|
return 0;
|
||
|
}
|