What will be printed as a result of the following code execution?
#include <iostream>
using namespace std;

struct A {
    A& operator++(int) {
        cout << "++";
        return *this;

    A& operator--(int){
        cout << "--";
        return *this;

int main() {
    A a;
    return 0;

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Sign Up Now
or Subscribe for future quizzes