what is pointer
Answer / 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 |
What is bss in c?
Why we write conio h in c?
Which of the following operators is incorrect and why? ( >=, <=, <>, ==)
what is the difference between : func (int list[], ...) or func (int *list , ....) - what is the difference if list is an array and if also if list is a pointer
How is a null pointer different from a dangling pointer?
How can I remove the trailing spaces from a string?
sir i wanted to know how we wap in c to add numbers without using arithmetic operator in which digits are entered by user?
what is the disadvantage of using macros?
What are pointers?
0 Answers Accenture, Tavant Technologies, Zensar,
write a program to print infinte number
int *p=20; if u print like dis printf("%d",p); o\p:- 20; how is it possible? plz give me the explanation.
WRITE A PROGRAM TO PRINT THE FOLLOWING OUTPUTS USING FOR LOOPS. A) * B) ***** *** * * ***** * * *****