Horizontal ==> fscanf, Vertical ==> ???

This is a discussion on Horizontal ==> fscanf, Vertical ==> ??? within the C Programming forums, part of the General Programming Boards category; fscanf() reads a line of data horizontally......(E.g: "AAA BBB CCC DDD....") and can assign its value one by one into ...

  1. #1
    Registered User
    Join Date
    Feb 2005
    Posts
    32

    Question Horizontal ==> fscanf, Vertical ==> ???

    fscanf() reads a line of data horizontally......(E.g: "AAA BBB CCC DDD....")

    and can assign its value one by one into an array variable
    (E.g: array[0] = "AAA" array[1]= "BBB"...)


    If I were to read the data downwards vertically and assign the values into an array variable....

    Code:
    E.g:
     "AAA"
     "BBB"
     "CCC" 
     "DDD"
        .
        .
        .
    array[0] = "AAA" array[1]= "BBB"...

    Any suggestions to do it....??
    __________

  2. #2
    & the hat of GPL slaying Thantos's Avatar
    Join Date
    Sep 2001
    Posts
    5,681
    You'd have to read in one line at a time and then add each letter to a string that respresented the column.

  3. #3
    Registered User
    Join Date
    Feb 2005
    Posts
    32
    Ohhh.......that's the way to do it...?? I did that and I thought it was a very crude way of doing it......I thought there are some functions or what to do the job......

    Thanks man! Your answer makes me feel more confident in programming......


    _____

  4. #4
    Registered User
    Join Date
    Feb 2005
    Posts
    32
    No....I mean I really thank you......not being sarcastic.

    _____

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. fscanf causes a SEGMENTATION FAULT
    By yougene in forum C Programming
    Replies: 15
    Last Post: 12-29-2008, 12:11 AM
  2. fscanf in different functions for the same file
    By bchan90 in forum C Programming
    Replies: 5
    Last Post: 12-03-2008, 09:31 PM
  3. List box horizontal bar
    By cfriend in forum Windows Programming
    Replies: 1
    Last Post: 09-12-2004, 04:52 PM
  4. Collision detection algorithm
    By Hannwaas in forum Game Programming
    Replies: 5
    Last Post: 11-30-2001, 01:27 PM
  5. vertical, horizontal and diagonal arrays
    By Unregistered in forum C Programming
    Replies: 1
    Last Post: 11-21-2001, 03:30 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21