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

Author Topic: What is the difference between char *a and char a[]?  (Read 316 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
5141 Views
Last post 02-04-2012, 13:06:47
by dany
6 Replies
2452 Views
Last post 10-24-2011, 00:30:13
by Hogward
22 Replies
10079 Views
Last post 12-04-2016, 23:34:48
by annarichart
34 Replies
16708 Views
Last post 03-25-2014, 06:13:10
by parijatziw
4 Replies
1605 Views
Last post 11-28-2012, 00:13:19
by DavisJoseph