fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. struct sampleA{
  5. static int multi(int value){
  6. return 3*value;
  7. }
  8. };
  9. struct sampleB{
  10. int get(int value){
  11. return 12 + sampleA::multi(value);
  12. }
  13. };
  14. int main() {
  15. sampleB b;
  16. cout << b.get(2) << endl;//18
  17. return 0;
  18. }
Success #stdin #stdout 0.01s 5316KB
stdin
Standard input is empty
stdout
18