online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
/****************************************************************************** Online C++ Compiler. Code, Compile, Run and Debug C++ program online. Write your code in this editor and press "Run" button to compile and execute it. *******************************************************************************/ #include <iostream> #include <cstddef> #include <algorithm> #include <string.h> using namespace std; template <typename T> bool safe_copy(T * dest, size_t dest_count, const T * source, size_t source_count) { auto const dest_bytes = sizeof(dest[0]) * dest_count; auto const source_bytes = sizeof(source[0]) * source_count; // // if (dest_bytes < source_bytes) return false; // // return memcpy( (void*)dest, (const void *)source, sizeof(source[0]) * source_count ) == dest; } int main() { char data0[10]; char data1[10]{'1', '2', '3', '4', '5', '6', '7', '8', '9', '0'}; safe_copy(&data0[0], 10, &data1[0], 10); for(auto c: data0) std::cout << c << "\n"; return 0; }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue