online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
#include <iostream> #include"header.h" int main() { t::inc(); std::cout << t::i << std::endl; // -> output is: 1 t::print_i(); // -> output is : 1 }
#ifndef UNTITLED1_TEST_H #define UNTITLED1_TEST_H namespace t { inline int i{0};//note the keyword inline here and initializer void inc() ; void print_i() ; } #endif
#include "header.h" #include<iostream> //No need for initilaizing t::i here void t::inc() { t::i++; } void t::print_i() { std::cout << t::i << std::endl; }

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