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

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

Offline chinmay.sahooTopic starter

  • Trade Count: (0)
  • Full Member
  • ***
  • Thank You 2
  • Posts: 153
  • Karma: 0
    • No Addiction
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
4953 Views
Last post 02-04-2012, 13:06:47
by dany
6 Replies
2372 Views
Last post 10-24-2011, 00:30:13
by Hogward
24 Replies
9774 Views
Last post 12-04-2016, 23:34:48
by annarichart
34 Replies
16382 Views
Last post 03-25-2014, 06:13:10
by parijatziw
4 Replies
1525 Views
Last post 11-28-2012, 00:13:19
by DavisJoseph