Answer Posted / vignesh1988i
a pointer is an memory location in which it holds a particular ADDRESS of a particular data type. and mean while through the ADDRESS it will point to that corresponding value in that data typed variable.
DECLARATION OF A POINTER VARIABLE :
int *pointer_variable;
for eg:
int a=45; //line 1
int *b; // line 2
b=&a; //line 3
printf("%d\n",*b); //line 4
explanation:
line 1 :
consider let address of the location 'a' be 1000, which contains a value 45 of integer data type.
line 2 :
*b , represents the integer pointer which can hold an integer variable address.
line 3 :
when we take any variable such as int a or int c etc, when we call as 'a' we will refer to the content inside 'a' (for eg.),in the same way as in the above coding *b is given . but b=&a; this means when we call 'b' the content (ie) the address of variable 'a', and that 'b' will be pointing indirectly the value of 'a' through the 'a's address.
line 4 :
when we want to refer to that pointed value we must give as *pointer_variable & here *b when you give the same 45 will get printed.
thank u
| Is This Answer Correct ? | 5 Yes | 0 No |
Post New Answer View All Answers
What is an example of structure?
In this assignment you are asked to write a multithreaded program to find the duplicates in an array of 10 million integers. The integers are between -5000,000 to 5000,000 and are generated randomly. Use 10 threads, each thread works on 1000,000 integers. Compare the time needed to accomplish the task with single thread of execution program. Do not include the time to fill the array with integers in the execution time.
Does c have circular shift operators?
How do I get a null pointer in my programs?
Why is c known as a mother language?
What are the preprocessor categories?
i want to switch my career from quailty assurance engineering to development kindly guide me from which programming language its better for me to start plz refer some courses or certifications too i have an experience of 1.5 yrs in QA field.Kindly guide me
What is the g value paradox?
Explain how can I prevent another program from modifying part of a file that I am modifying?
Write a program, where i have a grid with many cells, how many paths are possible from one point to other desired points.
Is there a way to jump out of a function or functions?
How are portions of a program disabled in demo versions?
What is the difference between abs() and fabs() functions?
Are negative numbers true in c?
Explain what will be the outcome of the following conditional statement if the value of variable s is 10?