What is the difference between char *a and char a[]?

Author Topic: What is the difference between char *a and char a[]?  (Read 356 times)

Offline chinmay.sahooTopic starter

  • Trade Count: (0)
  • Full Member
  • ***
  • Thank You 2
  • Posts: 159
  • Karma: 0
    • Hot Shaper
Char a[] = “Name”
    The above statement allocates 5 memory location, for the above declared statement.
    Char *a = “Name”
    in front of a shows pointer declaration. The complier asks to place to hold the pointer. Memory address will given the name ‘a’ and it points to the array of seven character.


 

Related Topics

  Subject / Started by Replies Last post
23 Replies
5382 Views
Last post 02-04-2012, 13:06:47
by dany
6 Replies
2572 Views
Last post 10-24-2011, 00:30:13
by Hogward
22 Replies
10507 Views
Last post 12-04-2016, 23:34:48
by annarichart
34 Replies
17173 Views
Last post 03-25-2014, 06:13:10
by parijatziw
4 Replies
1686 Views
Last post 11-28-2012, 00:13:19
by DavisJoseph