#include <iostream>
using namespace std;
 
class foo
{
public:
    int bar=5; //вот так 
    
    foo();
};
 
// Где- то cpp
foo::foo():bar(10)
{
}
 
 
int main()
{
    foo f;
    std::cout << f.bar << std::endl; // 10
}