Answer Posted / inderchauhan
A pointer is a special kind of variable in C and C++ that
holds the address of another variable.
my first pointer
#include <iostream>
using namespace std;
int main ()
{
int firstvalue, secondvalue;
int * mypointer;
mypointer = &firstvalue;
*mypointer = 10;
mypointer = &secondvalue;
*mypointer = 20;
cout << "firstvalue is " << firstvalue << endl;
cout << "secondvalue is " << secondvalue << endl;
return 0;
}
firstvalue is 10
secondvalue is 20
Is This Answer Correct ? | 1 Yes | 1 No |
Post New Answer View All Answers
Why c is called a middle level language?
How can I do graphics in c?
What is pointer to pointer in c language?
I was asked to write a program in c which when executed displays how many no.of clients are connected to the server.
How was c created?
What is the function of multilevel pointer in c?
When I tried to go into a security sites I am denied access and a message appeared saying 'applet not initialize'. How can I rectify this problem.
What is the most efficient way to count the number of bits which are set in an integer?
How many main () function we can have in a project?
Why is struct padding needed?
What does 1f stand for?
What is string constants?
What is modeling?
How are structure passing and returning implemented?
Is there any demerits of using pointer?