Jump to content


Photo

c++







  • Please log in to reply
6 replies to this topic

#1 akanksha singhai






Posted 05 February 2011 - 02:54 PM

- PLEASE SHARE

difference b/w char*x and char x[]


#2 sureshgummalla

sureshgummalla

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 05 February 2011 - 04:33 PM

difference b/w char*x and char x[]

In char*x, the variable x is a pointer of character type(a pointer is variable which points(represent) to some memory location) in char x[] the x is a array of character type (like string). :D

#3 sean lopez

sean lopez

    Advanced Member

  • Members
  • PipPipPip
  • 241 posts

Posted 07 February 2011 - 09:45 AM

I hope this source will help you http://bytes.com/top...een-char-char-x

#4 Alice Coope

Alice Coope

    Advanced Member

  • Members
  • PipPipPip
  • 45 posts

Posted 28 February 2011 - 03:09 PM

You can check out this discussion- http://stackoverflow...-char-and-char1

#5 Alice Coope

Alice Coope

    Advanced Member

  • Members
  • PipPipPip
  • 45 posts

Posted 28 February 2011 - 03:09 PM

You can check out this discussion- http://stackoverflow...-char-and-char1

#6 RupinKhandelwal

RupinKhandelwal

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 19 August 2011 - 06:13 PM

difference b/w char*x and char x[]

In char * x is the pointer pointing to the intial memory location and size of the pointer is not fix. but in char x[] we have to initialize the array of fix size.

#7 Mr. Sumit kumar

Mr. Sumit kumar

    Member

  • Members
  • PipPip
  • 11 posts

Posted 01 December 2011 - 12:52 PM

The difference here is that char *x puts in the read-only parts of the memory and making x a pointer to that, making any writing operation on this memory illegal. While doing: char x[] puts in read-only memory and copies to newly allocated memory on the stack. _____________ SEO Swindon