#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;
}