#include <iostream>
struct A {
int val_;
A(int v) : val_(v) { }
void setPrintVal(int v) const
{
val_ += v;
std::cout << val_ << endl;
}
};
int main()
{
A a(10);
int value = 20;
a.setPrintVal(++value);
}
Login in to like
Login in to comment