31 lines
No EOL
399 B
C++
31 lines
No EOL
399 B
C++
/*
|
|
Rafay Ahmad
|
|
23I-2526
|
|
*/
|
|
#include <iostream>
|
|
using namespace std;
|
|
|
|
class Count{
|
|
public:
|
|
int count;
|
|
|
|
Count() : count(0){}
|
|
|
|
int operator++(){
|
|
count++;
|
|
return count;
|
|
}
|
|
int operator++(int){
|
|
count++;
|
|
return count-1;
|
|
}
|
|
};
|
|
|
|
int main(){
|
|
|
|
Count c1;
|
|
cout<<"Inital value: "<<c1.count<<endl;
|
|
cout<<"Postfix increment"<<c1++;
|
|
|
|
return 0;
|
|
} |