Created
May 1, 2020 21:09
-
-
Save dkurt/d3021a800ab4e1165fa08ac0cd154d5f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// g++ main.cpp -o out && ./out | |
#include <stdio.h> | |
class Counter { | |
public: | |
Counter() : i(0) {} | |
int next() { | |
i += 1; | |
return i; | |
} | |
private: | |
int i; | |
}; | |
void print(int a, int b, int c, int d); | |
int main(int argc, char** argv) { | |
Counter counter; | |
print(counter.next(), counter.next(), counter.next(), counter.next()); | |
return 0; | |
} | |
void print(int a, int b, int c, int d) { | |
printf("%d %d %d %d\n", a, b, c, d); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment