online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <iostream> #include "R.hpp" #include "S.hpp" #include <memory> int main() { auto s = std::make_shared<n1::n2::S>(); auto r = std::make_shared<n1::c1::R>(s); r->r(); //s.print(); return 0; }
#ifndef S_H #define S_H #include <string> #include <iostream> #include <utility> #include <memory> namespace n1 { namespace n2 { typedef std::pair<uint32_t, uint32_t> conf; const conf def1 = std::make_pair(10, 2); const conf def2 = std::make_pair(20, 4); struct S { int x; inline void print(); }; using Sptr = std::shared_ptr<S>; } } #endif
#include "S.hpp" namespace n1 { namespace n2 { void S::print() { std::cout<<"S-print\n"; } } }
#ifndef R_H #define R_H #include "S.hpp" #include <memory> namespace n1 { namespace c1 { struct R { R(n1::n2::Sptr s); void r(); n1::n2::Sptr s_; }; } } #endif
#include "R.hpp" namespace n1 { namespace c1 { R::R(n1::n2::Sptr s):s_(s) {} void R::r() { n1::n2::conf c; std::cout<<"---s.first: " << c.first; } } }

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