1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

String problem

Discussion in 'C' started by singh_r85, May 31, 2010.

  1. singh_r85

    singh_r85 New Member

    Joined:
    May 25, 2010
    Messages:
    19
    Likes Received:
    0
    Trophy Points:
    0
    What is the difference between char a[] = "string"; and
    char *p = "string"; ?
     
  2. pkbis28

    pkbis28 New Member

    Joined:
    May 25, 2010
    Messages:
    24
    Likes Received:
    0
    Trophy Points:
    0
    The first declares an initialized and modifiable array; the
    second declares a pointer initialized to a not-necessarily-
    modifiable constant string.
     

Share This Page