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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What are dangling pointers? How are dangling pointers different from memory leaks?

899


i want to know the procedure of qualcomm for getting a job through offcampus

2182


Why do we use int main?

826


Can static variables be declared in a header file?

803


please give me a VIRTUSA sample palcement papers.... you will only send TECHNICAL SECTION..... that is help for me Advance Thanks........................

1741


List the difference between a While & Do While loops?

830


Write a C program linear.c that creates a sequence of processes with a given length. By sequence it is meant that each created process has exactly one child. Let's look at some example outputs for the program. Here the entire process sequence consists of process 18181: Sara@dell:~/OSSS$ ./linear 1 Creating process sequence of length 1. 18181 begins the sequence. An example for a sequence of length three: Sara@dell:~/OSSS$ ./linear 3 Creating process sequence of length 3. 18233 begins the sequence. 18234 is child of 18233 18235 is child of 18234 ........ this is coad .... BUt i could not compleate it .....:( #include #include #include #include int main(int argc, char *argv[]) { int N; pid_t pid; int cont; if (argc != 2) { printf("Wrong number of command-line parameters!\n"); return 1; } N = atoi(argv[1]); printf("Creating process sequence of length %d.\n",N); printf("%d begins the sequence.\n",getpid()); /* What I have to do next ?????? */ }

1837


What does void main () mean?

945


What should malloc(0) do? Return a null pointer or a pointer to 0 bytes?

802


Explain what is a program flowchart and explain how does it help in writing a program?

846


What is the difference between memcpy and memmove?

768


Given an array of 1s and 0s arrange the 1s together and 0s together in a single scan of the array. Optimize the boundary conditions?

1222


how we can make 3d venturing graphics on outer interface

4329


void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }

1463


How many types of operators are there in c?

794