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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

C stuff

  • 04-05-2005 12:37am
    #1
    Registered Users, Registered Users 2 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, Registered Users 2 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