TimeStamp C

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

1. difference between char str[] or char str[50] and char *str ?

Ans - a ). In this type of initiliztion char str[] or char str[50] we need to


assign value at the time of declaration.
if we assign value after declaration its raise error

b ). In this type of initiliztion char *str we assign value after declaration


or at time of declaration.
c ). We use char *str if we want to change the value of string at run time
and we use char str[] or char str[50] when we dont
want to change value its like constant variable.

2. Subtract Pointer from Pointer ?

3. Input buffer?
4. can i use struct datatypeName variableName as pointer just like we do in
arrays . array name pointing its first element by default for example int num[10];
now we can change or set the num 0 index value using *num=55; // *num=55 ->
num[0]=55;.1. difference between char str[] or char str[50] and char *str ?

Ans - a ). In this type of initiliztion char str[] or char str[50] we need to


assign value at the time of declaration.
if we assign value after declaration its raise error

b ). In this type of initiliztion char *str we assign value after declaration


or at time of declaration.
c ). We use char *str if we want to change the value of string at run time
and we use char str[] or char str[50] when we dont
want to change value its like constant variable.

2. Subtract Pointer from Pointer ?

3. Input buffer?
4. can i use struct datatypeName variableName as pointer just like we do in
arrays . array name pointing its first element by default for example int num[10];
now we can change or set the num 0 index value using *num=55; // *num=55 ->
num[0]=55;.1. difference between char str[] or char str[50] and char *str ?

Ans - a ). In this type of initiliztion char str[] or char str[50] we need to


assign value at the time of declaration.
if we assign value after declaration its raise error

b ). In this type of initiliztion char *str we assign value after declaration


or at time of declaration.
c ). We use char *str if we want to change the value of string at run time
and we use char str[] or char str[50] when we dont
want to change value its like constant variable.

2. Subtract Pointer from Pointer ?

3. Input buffer?
4. can i use struct datatypeName variableName as pointer just like we do in
arrays . array name pointing its first element by default for example int num[10];
now we can change or set the num 0 index value using *num=55; // *num=55 ->
num[0]=55;.

You might also like