diff --git a/examples/fizzbuzz.c.py.noug b/examples/fizzbuzz.cpp.c.py.noug similarity index 85% rename from examples/fizzbuzz.c.py.noug rename to examples/fizzbuzz.cpp.c.py.noug index aea1922..716dc2a 100644 --- a/examples/fizzbuzz.c.py.noug +++ b/examples/fizzbuzz.cpp.c.py.noug @@ -1,6 +1,6 @@ # /* -# This file can be executed both in Python, Nougaro and C, using NOUGAROIGNORE and docstrings. -# Change the extension of this file to allow GCC to recognise a C program +# This file can be executed in Nougaro, Python, C and C++, using NOUGAROIGNORE and docstrings. +# Change the extension of this file to allow GCC/G++ to recognise a C/C++ program # This is a simple FizzBuzz program. # */ #include @@ -9,12 +9,18 @@ ## NOUGAROIGNORE def fizzbuzz(n: int): """ - Fizzbuzz algorithm that both work in Nougaro, Python and C + Fizzbuzz algorithm that work in Nougaro, Python, C and C++ !""" """ */ +# ifdef __cplusplus +#include +void print(std::string x) { + std::cout << x << std::endl; +# else void print(char *x) { printf("%s\n", x); +# endif } /* #! NOUGAROIGNORE