1. We have moved from vBulletin to XenForo and you are viewing the site in the middle of the move. Though the functional aspect of everything is working fine, we are still working on other changes including the new design on Xenforo.
    Dismiss Notice

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