What is the difference between char str, char *str and char* str ?Explain the meaning of char* or int* ?

Questions by poorni1984

Showing Answers 1 - 3 of 3 Answers

rinas

  • Aug 30th, 2007
 

char str is a char variable which is capable to store one character.
char *str is capable to store a string. its length can be fixed only at run time.
for eg.


char *str;

for(int p=0;s[p];p++)
       putchar(str[p]);


in p we will have length of str

  Was this answer useful?  Yes

bornToLose

  • Sep 22nd, 2007
 

Char* is pointer to char which store address of char variable

IntI is a pointer to int which store the address of int variable.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions