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

char [] issue

Discussion in 'C' started by micsom, Nov 11, 2010.

  1. micsom

    micsom New Member

    Joined:
    Oct 13, 2008
    Messages:
    39
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Developer
    Location:
    I*N*D*I*A*
    I just came accross a piece of code like:

    char arrname[]={
    #include "xxx.txt"
    };

    what does this mean?
     
  2. micsom

    micsom New Member

    Joined:
    Oct 13, 2008
    Messages:
    39
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Developer
    Location:
    I*N*D*I*A*
    anyways...thanx i just debugged it and got the answer...
     
  3. xpi0t0s

    xpi0t0s Mentor

    Joined:
    Aug 6, 2004
    Messages:
    3,012
    Likes Received:
    203
    Trophy Points:
    0
    Occupation:
    Senior Support Engineer
    Location:
    England
    It's perfectly valid; if xxx.txt contains
    "hello",
    "world"

    then after preprocessing arrname will be defined as
    char arrname[]={
    "hello",
    "world"
    };
     

Share This Page