#include<iostream.h> class CuriousTab { int x; float y; public: void Function() { x = 4; y = 2.50; delete this; } void Display() { cout<< x << " " << y; } }; int main() { CuriousTab *pCuriousTab = new CuriousTab(); pCuriousTab->Function(); pCuriousTab->Function(); pCuriousTab->Display(); return 0; }
#include<iostream.h> class CuriousTab { int x, y; public: void SetValue(int &xx, int &yy) { x = xx++; y = yy; cout<< xx << " " << yy; } }; int main() { int x = 10; int &y = x; CuriousTab objCuriousTab; objCuriousTab.SetValue(x , y); return 0; }
#include<iostream.h> enum xyz { a, b, c }; int main() { int x = a, y = b, z = c; int &p = x, &q = y, &r = z; p = ++x; q = ++y; r = ++c; cout<< p << q << r; return 0; }
#include<iostream.h> int main() { int m = 2, n = 6; int &x = m; int &y = n; m = x++; x = m++; n = y++; y = n++; cout<< m << " " << n; return 0; }
#include<iostream.h> int main() { int arr[] = {1, 2 ,3, 4, 5}; int &zarr = arr; for(int i = 0; i <= 4; i++) { arr[i] += arr[i]; } for(i = 0; i <= 4; i++) cout<< zarr[i]; return 0; }
#include<iostream.h> int main() { int x = 80; int y& = x; x++; cout << x << " " << --y; return 0; }
Comments
There are no comments.Copyright ©CuriousTab. All rights reserved.