what is the difference between normal variables and pointer
variables..............
Answers were Sorted based on User's Feedback
Answer / guest
normal variables carry the specified data where as the
pointer variable carried the address of the specified data,,,,,
eg: if we give int x =10; ptr p=*x;here x is the normal
variable carries 10 and pointer variable is p which carried
address of the integer variable x.
Is This Answer Correct ? | 215 Yes | 31 No |
Answer / sree
normal variable stores a value of the given datatype where
as the pointer variable stores the address of a variable.
for example
int n=10;
int *p;
p=&n;
here p is a pointer variable and n is a normal
variable.p stores the address of n where as n stores an
integer value.
*p prints the value of n,p prints the address
of n.
Is This Answer Correct ? | 117 Yes | 19 No |
Normal variable is a variable which can hold a value as like
eg. int,float or char,it may be signed or unsigned and take
different memory space as per as their data type.But the
pointer variable is a variable which hold the address of a
another variable,and it is obviously unsigned and take
always 2 byte in memory space.
Is This Answer Correct ? | 88 Yes | 23 No |
Answer / sasireka
normal variable contains tha value of variable either int
or float whereas pointer variable contains the address of
another variable
Is This Answer Correct ? | 65 Yes | 32 No |
Answer / vignesh1988i
NORMAL VARIABLES POINTER VARIABLES
it holds a data it holds the address
of variable
another data when we
we make it to point
it can be directly referred data can be referred as *
by it's variable name
normal variables don't have data it has full data security
security
thank u
Is This Answer Correct ? | 37 Yes | 13 No |
Answer / fatima javaid
"Pointer variable holds memory address or physical address
of any variable value means it indirectly points any
vaiable,we can perform all operations +,*,-,and / through
it but normal variable directly points vaiable value"
Is This Answer Correct ? | 21 Yes | 5 No |
Answer / mani
Normal variable:memory size of variables depends upon respective datatype; if int it'll take 2byte , char will take 1 byte.
Pointer variable:memory size of pointer variable is constant that is 4byte in gcc compiler irrespective of any datatype.
Is This Answer Correct ? | 7 Yes | 1 No |
Answer / yshwanth
variable is an memory alocation were the value keps on
changing during the execution of the program
Is This Answer Correct ? | 11 Yes | 7 No |
Answer / abdinadir mohamed abdulle
"Pointer variable holds memory address or physical address
of any variable value means it indirectly points any
vaiable,we can perform all operations +,*,-,and / through
it but normal variable directly points vaiable value"
Is This Answer Correct ? | 6 Yes | 2 No |
Answer / ashu_deepu
one thing i wanna add is we canot perform some operation
with the pointers (like subtraction) while those can b
performed with the normal variables.
Is This Answer Correct ? | 15 Yes | 12 No |
How was c created?
write a c programme for add of two numbers with out use of arthematic operators
Can you please explain the difference between malloc() and calloc() function?
c program to compute AREA under integral
44.what is the difference between strcpy() and memcpy() function? 45.what is output of the following statetment? 46.Printf(“%x”, -1<<4); ? 47.will the program compile? int i; scanf(“%d”,i); printf(“%d”,i); 48.write a string copy function routine? 49.swap two integer variables without using a third temporary variable? 50.how do you redirect stdout value from a program to a file? 51.write a program that finds the factorial of a number using recursion?
Explain what is meant by high-order and low-order bytes?
in one file global variable int i; is declared as static. In another file it is extern int i=100; Is this valid ?
What do you mean by dynamic memory allocation in c?
Is null valid for pointers to functions?
Write a program to replace n bits from the position p of the bit representation of an inputted character x with the one's complement. Method invertBit takes 3 parameters x as input character, p as position and n as the number of positions from p. Replace n bits from pth position in 8 bit character x. Then return the characters by inverting the bits.
What is the difference b/w Structure & Array?
Read N characters in to an array . Use functions to do all problems and pass the address of array to function. 1. Print only the alphabets . If in upper case print in lower case vice versa.