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 |
Program to swap the any two elements in an array containing N number of elements?
1 Answers Bosch, Glenwood, Ugam Solutions,
define string ?
a linear linked list such that the link field of its last node points to the first node instead of containing NULL a) linked list b) circular linked list c) sequential linked list d) none
What is atoi and atof in c?
i want the code for printing the output as follows 4 4 3 3 2 2 1 1 0 1 1 2 2 3 3 4 4
What is the use of linkage in c language?
How can I access an I o board directly?
how to implement stack operation using singly linked list
why u join this call center?
What is the difference between typedef and #define?
What is the scope of local variable in c?
#include<stdio.h> main() {int i=1;j=1; for(;;) {if(i>5) break; else j+=1; printf("\n%d",j) i+=j; } }