diff --git a/tests/testdata/cpp/simple/.gitignore b/tests/testdata/cpp/simple/.gitignore index fec4c0b..d3a7590 100644 --- a/tests/testdata/cpp/simple/.gitignore +++ b/tests/testdata/cpp/simple/.gitignore @@ -1,3 +1,4 @@ simple variables struct +printer diff --git a/tests/testdata/cpp/simple/printer.cpp b/tests/testdata/cpp/simple/printer.cpp new file mode 100644 index 0000000..1e4a0b7 --- /dev/null +++ b/tests/testdata/cpp/simple/printer.cpp @@ -0,0 +1,21 @@ +#include +#include + +int main( int argc, char** argv ) +{ + if ( ( argc - 1 ) % 2 ) + { + std::cerr << "Unbalanced arguments\n"; + return 1; + } + + for ( int i=1; i < argc; i += 2 ) + { + std::cout << argv[ i ] + << ": " + << argv[ i + 1 ] + << '\n'; + } + + return 0; +}