Hello
Am new to pointers
Can anyone write a simple program with a simple function with pointers??
any function
I need to see examples for this
OR: If you have websites covering this?
I DO NOT WANT A WEBSITE EXPLAIN POINTERS !!
i want codes having function with pointers
thanks in advanced..
Okay, I know you said specifically that you don't want a website, but honestly, there are so many ways to work with pointers that it's absolutely pointless for anyone to post sample code here. Trust me, you do need to read up on them first. If you have specific questions after that, feel free to post them.
So, despite your request for no websites, my best answer is to point you to the tutorial section:
// Prototype
void FuncX( int* );
main() {
// Declare and initialize an int
int A = 99;
// Pass the address of A
FuncX( &A );
//See the results
cout << A;
}
// FuncX receives the address of any int into a pointer to an int
void FuncX( int* pX ) {
// Set what pX is pointing to to a new value
*pX = 12345;
}
Thanks for all !!
sorry for the late reply
I got A- !! :$
Oh my god
I can not believe that I finished that horrible semester :S
thanks again
Goodbye C++ !!