#include <unistd.h>
int main() {
int size;
size = 12;
int my_array[size];
my_array[0] = 65;
my_array[1] = 66;
my_array[2] = 10; // ASCII line feed.
my_array[11] = 10;
char hello_world[] = { 72, 101, 108, 108, 111, 32, 119, 111, 114, 108, 100, 33, '\0' };
write(1,"Hello world!\n",12);
write(1,"\n",1);
write(1,&my_array,12);
write(1,"\n",1);
write(1,&hello_world,12);
/*
int ascii_values[] = {
72, // 'H'
10, // '\n'
101, // 'e'
10, // '\n'
32, 108, // 'l' (preceded by a space)
10, // '\n'
32, 108, // 'l' (preceded by a space)
10, // '\n'
32, 111, // 'o' (preceded by a space)
10, // '\n'
32, 32, 119, // 'w' (preceded by two spaces)
10, // '\n'
32, 32, 111, // 'o' (preceded by two spaces)
10, // '\n'
32, 32, 114, // 'r' (preceded by two spaces)
10, // '\n'
32, 32, 108, // 'l' (preceded by two spaces)
10, // '\n'
32, 32, 100, // 'd' (preceded by two spaces)
10, // '\n'
33, // '!'
10 // '\n'
};
write(1, ascii_values, sizeof(ascii_values) / sizeof(int));
*/
return 0;
}
To embed this project on your website, copy the following code and paste it into your website's HTML: