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

How to take different types of data from a text file to an array(2-D) using pointer

Discussion in 'C' started by Ani801, Mar 23, 2012.

  1. Ani801

    Ani801 New Member

    Joined:
    Mar 23, 2012
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    I have a text file containing a schedule like below-

    B - (2,3) (5,7) (10,12)
    C - (7,8) (11,12)
    G - (5,6) (10,11)
    F - (1,2) (4,6) (9,11)

    Please help me, how I can take the above data from that text file (suppose "a.txt") to an array(2-D) in a C-program using pointer
     
  2. priyatendulkar

    priyatendulkar New Member

    Joined:
    Jun 20, 2011
    Messages:
    20
    Likes Received:
    1
    Trophy Points:
    0
    Re: How to take different types of data from a text file to an array(2-D) using point

    hi,

    Jst need some info..
    As per your req..You will have 4 (2-D ) arrays

    B , C, G, F ..Is it so or Have I misinterpreted your question
     
  3. Ani801

    Ani801 New Member

    Joined:
    Mar 23, 2012
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Re: How to take different types of data from a text file to an array(2-D) using point

    Mainly, I have to take the data- "B 2 3 5 7 10 12 C 7 8 11 12 G 5 6 10 11 F 1 2 4 6 9 11" from text file containing - " B - (2,3) (5,7) (10,12)
    C - (7,8) (11,12)
    G - (5,6) (10,11)
    F - (1,2) (4,6) (9,11) "
    using pointer
     

Share This Page