You can’t write code outside of functions. The only things you can have outside of functions are declarations such as global variable declarations (usually a bad idea), function declarations etc. Try putting it in a function like int main(){}
More Related Contents:
- C++ – Find numbers between first and last negative numbers in Array
- Hi, Just Want to Know What This Error Means
- Is it better in C++ to pass by value or pass by constant reference?
- Why does changing 0.1f to 0 slow down performance by 10x?
- Is std::vector so much slower than plain arrays?
- Callback functions in C++
- How could pairing new[] with delete possibly lead to memory leak only?
- What C++ Smart Pointer Implementations are available?
- Easy way to parse a url in C++ cross platform?
- How to compile C code with anonymous structs / unions?
- Using regex lookbehinds in C++11
- Check at Compile-Time if Template Argument is void
- What does {0} mean when initializing an object?
- Fast Cross-Platform C/C++ Image Processing Libraries
- Limiting range of value types in C++
- Deducing first template argument with other template parameters defaulted
- How to get the process name in C++
- Passing End of Transmission (Ctrl + D) character in Eclipse CDT console
- How do I implement a Bézier curve in C++?
- Is “inline” implicit in C++ member functions defined in class definition
- size_t vs int in C++ and/or C
- Capturing a time in milliseconds
- cannot convert ‘const char*’ to ‘LPCWSTR {aka const wchar_t*}’
- How Can I Pass a Member Function to a Function Pointer?
- error::make_unique is not a member of ‘std’
- Template Metaprogramming – Difference Between Using Enum Hack and Static Const
- Confusion about pointers and references in C++
- How is its lifetime of a return value extended to the scope of the calling function when it is bound to a const reference in the calling function?
- Why can’t std::function bind to C-style variadic functions?
- How to count clock cycles with RDTSC in GCC x86? [duplicate]