int main(int argc, char** argv) { Something a; Something b(42); if (a.showMe() == 42) { Something b; cout << "a is 42. Showing b: " << b.showMe() << endl; } else { cout << "a isn’t 42. Showing b: " << b.showMe() << endl; } }
int main() { Something something; int x= something.work_a(); std::cout << x << std::endl; return 0; }
void testAnonymous() { #ifndef Q_CC_RVCT TestAnonymous a; a.i = 1; a.i = 2; a.i = 3; Something s; s.foo(); #endif }
int main() { Something myThing; myThing.setThing( [&]() { return 1; }, [&]() { return 2; }, [&]() { return 3; } ); std::cout << myThing.run(); }
int main() { Something cFirst; Something cSecond; Something cThird; std::cout << cFirst.GetID() << std::endl; std::cout << cSecond.GetID() << std::endl; std::cout << cThird.GetID() << std::endl; return 0; }
int main() { Something cFirst; Something cSecond; Something cThird; using namespace std; cout << cFirst.GetID() << endl; cout << cSecond.GetID() << endl; cout << cThird.GetID() << endl; return 0; }
int main() { Something something; something.setValue1(5); std::cout << something.getValue1() << '\n'; };
int operator+=(Something& t) { return total = total + t.GetCount(); }
int main() { Something some; cout << "m_value1 : "<<some.getNum()<< " m_value2 : "<<some.getDen()<< endl; return 0; }