#include <unistd.h>
int my_strlen(const char *str) {
int len = 0;
while (str[len] != '\0') {
len++;
}
return len;
}
void my_strcpy(char *dest, const char *src) {
int i = 0;
while (src[i] != '\0') {
dest[i] = src[i];
i++;
}
dest[i] = '\0';
}
int main() {
// Declare an empty string with a fixed size
char string[100] = "";
// Populate the string with a value later
my_strcpy(string, "Hello, world!");
// Print the string
write(1, string, my_strlen(string));
write(1, "\n", 1);
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: