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
What are types of structure?
A program is required to print your biographic information including: Names, gender, student Number, Cell Number, line of study and your residential address.
Write a Program to find whether the given number or string is palindrome.
What does the && operator do in a program code?
What is the value of uninitialized variable in c?
What is malloc() function?
Is there sort function in c?
What is self-referential structure in c programming?
What is typedf?
Explain the array representation of a binary tree in C.
What is the benefit of using #define to declare a constant?
Why c is called free form language?
Can we declare variable anywhere in c?
What are structure types in C?
.main() { char *p = "hello world!"; p[0] = 'H'; printf("%s",p); }