My header class
class rectangle{
private:
int x,y;
public:
void setValue(int,int);
int area(void);
};
Wednesday, July 11, 2007
Thursday, July 5, 2007
Pointers
//Pointer is the address in the memory.
#include
using namespace std;
int main(){
int x;
int * mypointer;
mypointer = &x;
*mypointer = 2;
x = 3;
cout << "Value of x is: " << *mypointer << endl;
//What we will get?
return 0;
}
#include
using namespace std;
int main(){
int x;
int * mypointer;
mypointer = &x;
*mypointer = 2;
x = 3;
cout << "Value of x is: " << *mypointer << endl;
//What we will get?
return 0;
}
Subscribe to:
Posts (Atom)