Skip to content

Commit

Permalink
Use ascii code instead of char
Browse files Browse the repository at this point in the history
casting from char to u8 is not supported
  • Loading branch information
JulianGCalderon committed May 9, 2024
1 parent 3a25d5e commit 16fda9f
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions examples/hello_world_hacky.con
Original file line number Diff line number Diff line change
Expand Up @@ -6,29 +6,29 @@ mod HelloWorld {
let origin: *mut u8 = malloc(12);
let mut p: *mut u8 = origin;

*p = 'H';
*p = 72;
p = p + 1;
*p = 'e';
*p = 101;
p = p + 1;
*p = 'l';
*p = 108;
p = p + 1;
*p = 'l';
*p = 108;
p = p + 1;
*p = 'o';
*p = 111;
p = p + 1;
*p = ' ';
*p = 32;
p = p + 1;
*p = 'W';
*p = 87;
p = p + 1;
*p = 'o';
*p = 111;
p = p + 1;
*p = 'r';
*p = 114;
p = p + 1;
*p = 'l';
*p = 108;
p = p + 1;
*p = 'd';
*p = 100;
p = p + 1;
*p = '\0';
*p = 0;
puts(origin);

return 0;
Expand Down

0 comments on commit 16fda9f

Please sign in to comment.