Skip to content

Instantly share code, notes, and snippets.

@dkurt
Created May 1, 2020 21:09
Show Gist options
  • Save dkurt/d3021a800ab4e1165fa08ac0cd154d5f to your computer and use it in GitHub Desktop.
Save dkurt/d3021a800ab4e1165fa08ac0cd154d5f to your computer and use it in GitHub Desktop.
// 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