what is difference between declaring the pointer as int and
char in c language?

Answers were Sorted based on User's Feedback



what is difference between declaring the pointer as int and char in c language?..

Answer / karan

means of integer pointer a pointer variable which contains
a address of an integer value...means the address in the
pionter variable points to a integer type value....

And the means of chracter pointer, pionter variable is
contain a integer address of a character type value..

Is This Answer Correct ?    11 Yes 2 No

what is difference between declaring the pointer as int and char in c language?..

Answer / abhay3023

The first obvious difference is char pointer will store address of character variable and same way integer pointer will store address of integer variable.

But the main difference you will feel when do increment on both these pointers, integer pointer will get incremented by 4 bytes and character pointer will get incremented by 1 bytes.

Is This Answer Correct ?    2 Yes 0 No

what is difference between declaring the pointer as int and char in c language?..

Answer / k vishwanath pillay

While declaring Pointer for an Integer value, we assign a
default size i.e 4 byte of memory for the Integer variable.
But in the case of char by default it assigns 1 byte of
memory for that character variable.

The type of declaration is the same for both.

Char a[5], *p; // for char variable
int *i; // for Int variable

Is This Answer Correct ?    5 Yes 10 No

Post New Answer

More C Interview Questions

main() { int x=5; printf("%d %d %d\n",x,x<<2,x>>2); } what is the output?

9 Answers   Ramco,


What character terminates all strings composed of character arrays? 1) 0 2) . 3) END

3 Answers  


how to print 2-D array using a single for loop?

2 Answers   Mind Tree, TCS, Value Labs,


we have a 3litres jug and a 5 litres jug and no measures on them. using these two jugs how can we measure 4 litres of water?

2 Answers   Convergys,


What is the best style for code layout in c?

0 Answers  






What is line in c preprocessor?

0 Answers  


Explain can you assign a different address to an array tag?

0 Answers  


Explain what does a function declared as pascal do differently?

0 Answers  


How do we open a binary file in Read/Write mode in C?

0 Answers   Alter,


how can i get output like this? 1 2 3 4 5 6

6 Answers   Excel,


Describe dynamic data structure in c programming language?

0 Answers  


Define and explain about ! Operator?

0 Answers  


Categories