what is difference between declaring the pointer as int and
char in c language?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
pgm to find number of words starting with capital letters in a file(additional memory usage not allowed)(if a word starting with capital also next letter in word is capital cann't be counted twice)
What is the argument of a function in c?
write a c program to find the roots of a quadratic equation ax2 + bx + c = 0
11 Answers CSC, St Marys, TATA,
main() { int i=0; while(+(+i--)!=0) i-=i++; printf(i); }
program for reversing a selected line word by word when multiple lines are given without using strrev
What is volatile keyword in c?
Write the syntax and purpose of a switch statement in C.
Table of Sudoku n*n
How does variable declaration affect memory?
The performance of an operation in several steps with each step using the output of the preceding step a) recursion b) search c) call by value d) call by reference
Which operators cannot be overloaded a) Sizeof b) .* c) :: d) all of the above
Tell us the use of fflush() function in c language?