test
This commit is contained in:
parent
37776af5db
commit
ab03d5f10c
4045 changed files with 286212 additions and 3 deletions
34
.config/Code/User/History/21ee6032/fYBJ.cpp
Normal file
34
.config/Code/User/History/21ee6032/fYBJ.cpp
Normal file
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
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++<<endl;
|
||||
cout<<"After post increment"<<c1.count<<endl;
|
||||
cout<<"Prefix increment: "<<++c1<<endl;
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue