online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <array> #include <string.h> #include <stdio.h> using bar = struct bar { int x; char y; }; auto main() -> int { std::array<bar [3], 4> foo; bar myBar [3] = { { 1, 'a'}, { 2, 'b'}, {3, 'c'} }; // Compiler error "Invalid array assigment" //foo [0] = myBar; // This works and foo [0] has also the correct content memcpy( foo [0], myBar, sizeof(myBar) ); for ( auto const & fooBar : foo [0] ) { printf( "x=%d - y=%c\n", fooBar.x, fooBar.y ); } 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