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
Device an algorithm for weiler-atherton polygon clipping, where the clipping window can be any specified polygon
A function can make the value of a variable available to another by a) declaring the variable as global variable b) Passing the variable as a parameter to the second function c) Either of the two methods in (A) and (B) d) binary stream
What is a newline escape sequence?
How can I invoke another program (a standalone executable, or an operating system command) from within a c program?
What does static variable mean in c?
disply the following menu 1.Disply 2.Copy 3.Append; as per the menu do the file operations 4.Exit
How do you define CONSTANT in C?
What is the acronym for ansi?
Explain is it valid to address one element beyond the end of an array?
What is the purpose of the preprocessor directive error?
What does 1f stand for?
Which one would you prefer - a macro or a function?
What is methods in c?
can we have joblib in a proc ?
How can I ensure that integer arithmetic doesnt overflow?