Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

C stuff

Options
  • 04-05-2005 1:37am
    #1
    Registered Users Posts: 4,276 ✭✭✭


    Hey,

    Just working on my assignment and got a little stuck. I've to create a text editor for a unix enviroment. Anyways... one of the commands (Its meant to be like VI I guess ;) ) is to display the document to screen which is easy enough obviously :)

    However... it must display numbered lines. Anyone know if there are any built in libraries to do this with either C(1989 standard) or Unix calls ? Or am I going to have to count each line manually and print off a new number?


Comments

  • Registered Users Posts: 2,426 ✭✭✭ressem


    By what means are you displaying the document to screen?
    E.g. are you using ncurses library with output buffering? QT? printf?

    Ok I'll guess that you're trying to copy "less -N filename".

    Built in C library? Short answer, you'll have to manage keeping track of line numbers yourself. Don't know enough about your prog (scrolling/ linewrapping/resizable window?) to say whether this is trivial or not.


Advertisement