Formatting Output

This is a discussion on Formatting Output within the C Programming forums, part of the General Programming Boards category; Input:...

  1. #1
    Registered User
    Join Date
    Mar 2011
    Posts
    3

    Arrow Formatting Output

    Input:
    Last edited by m0nster; 03-07-2011 at 08:38 PM.

  2. #2
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Start getting your code together... work it as far as you can before you get stuck.
    If you run into trouble, post your code here and we'll see what we can do...

  3. #3
    Programming King Mr.777's Avatar
    Join Date
    Mar 2011
    Location
    Middle of NoWhere
    Posts
    320
    Well, i am ignoring what user has entered. Suppose, user has entered error free syntax code.
    You've to read some of the common things. Store all those things that you want to compare with the file, in an array.
    Start comparing them...
    Forexample,
    You need to indent if.
    What you need to do is to check the first paranthesis (opening) and then just one more paranthesis(closing). Indent here and keep using other things, similar to this...

    There can be many better solutions at the moment, but actually i got to go, that's why i didn't even read your specification carefully. I hope you will get help till tomorrow, but if you didn't surely i can try to help on this......

    Good luck...

  4. #4
    Registered User
    Join Date
    Mar 2011
    Posts
    3
    now i dont even have a clue

  5. #5
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by m0nster View Post
    now i dont even have a clue
    Ok, you need to think about this in small blobs... The overall program will never appear to you (or anyone else) in some magical moment of clarity. It's always about baby steps and small blobs of code...

    What's the first thing you have to do?
    You need the filename of the file to process
    Then what?
    You need to open the file

    Break the task down into small steps, write each step in turn...
    Pen and paper... make a list.

    Eventually you'll run out of steps and the program will be finished.

  6. #6
    Registered User
    Join Date
    Mar 2011
    Posts
    3
    Quote Originally Posted by CommonTater View Post
    Ok, you need to think about this in small blobs... The overall program will never appear to you (or anyone else) in some magical moment of clarity. It's always about baby steps and small blobs of code...

    What's the first thing you have to do?
    You need the filename of the file to process
    Then what?
    You need to open the file

    Break the task down into small steps, write each step in turn...
    Pen and paper... make a list.

    Eventually you'll run out of steps and the program will be finished.
    I started to love this forum...



    Problems:
    1) I've simple do this, the problem for the above codes is that I didnt use recursive
    2) The codes will only work if there's space between words.
    For example:
    printf("Welcome --- Will NOT work
    printf ("Welcome --- Will work
    3) I've manually added the number 29 (for for loop) which represent number of words

    My question is how to improve my codes so that I use recursive and to avoid problem number 2.

    and how to write back to the text file :S
    I think I can solve problem number 3 by counting number of words. Please help me with the first 2 problems.
    Please explain to me in detail, Im really not that smart and slow learner.

    Thank You very much
    Last edited by m0nster; 03-07-2011 at 08:39 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. formatting output
    By mrsirpoopsalot in forum C++ Programming
    Replies: 6
    Last Post: 10-07-2009, 02:18 PM
  2. Help me please.
    By yann in forum C Programming
    Replies: 15
    Last Post: 09-29-2009, 09:04 PM
  3. Formatting output to screen from a file
    By clearrtc in forum C Programming
    Replies: 2
    Last Post: 08-20-2006, 03:19 PM
  4. Base converter libary
    By cdonlan in forum C++ Programming
    Replies: 22
    Last Post: 05-15-2005, 01:11 AM
  5. formatting output
    By spliff in forum C Programming
    Replies: 2
    Last Post: 08-14-2001, 06:50 PM

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