diff options
Diffstat (limited to 'tests/hello_world_loop.cpp')
-rw-r--r-- | tests/hello_world_loop.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/hello_world_loop.cpp b/tests/hello_world_loop.cpp index 02241ff1..3ab717e3 100644 --- a/tests/hello_world_loop.cpp +++ b/tests/hello_world_loop.cpp @@ -2,6 +2,12 @@ #include<string.h> #include<stdlib.h> +extern "C" { + void dump(char *s) { + puts(s); + } +} + int main() { char *original = (char*)"h e l l o , w o r l d ! "; char *copy = (char*)malloc(strlen(original)); @@ -9,7 +15,7 @@ int main() { copy[i/2] = original[i]; } copy[strlen(copy)+1] = (int)&original; // force original to be on the stack - puts(copy); + dump(copy); return 1; } |