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

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