Thread: What is a text buffer ?

  1. #1
    Cogito Ergo Sum
    Join Date
    Mar 2007
    Location
    Sydney, Australia
    Posts
    463

    What is a text buffer ?

    I have an assignment to do, I have to do something with a textbuffer, the problem is I don't know what it is specifically.

    Googling it just led to some random definitions which didn't really have much to do with what I have to do in my assignment.

    Cheers
    =========================================
    Everytime you segfault, you murder some part of the world

  2. #2
    Jack of many languages Dino's Avatar
    Join Date
    Nov 2007
    Location
    Chappell Hill, Texas
    Posts
    2,332
    A text buffer is typically a char array, that holds a null terminated string.
    Mainframe assembler programmer by trade. C coder when I can.

  3. #3
    Cogito Ergo Sum
    Join Date
    Mar 2007
    Location
    Sydney, Australia
    Posts
    463
    Thanks Todd
    =========================================
    Everytime you segfault, you murder some part of the world

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    However, I would like to point out that in generic terms, a "textbuffer" is "some sort of buffer/container that can hold text" - it could be an array of lines or a linked list of lines for example.

    A very important question is what you actually intend to do with your text. [Although, if the text is relatively short, it would not make much difference - the difference comes when you start operating on files that are many thousands of lines, hundreds or more kilobytes - at least on a modern machine].

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  5. #5
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    > that holds a null terminated string.
    Doesn't have to be null terminated... Does it? :\

    Either way, it's still text.

  6. #6
    Cogito Ergo Sum
    Join Date
    Mar 2007
    Location
    Sydney, Australia
    Posts
    463
    According to my assignment criteria, a line is with \n. Where as the whole text terminates with \0.

    My assignment has to do with arrays in a linked list, but yea I just had to get past the first bit, I wasn't really sure what it was.

    Thanks
    =========================================
    Everytime you segfault, you murder some part of the world

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Function in a text buffer
    By wellsper in forum C Programming
    Replies: 5
    Last Post: 04-15-2010, 11:00 PM
  2. Replies: 16
    Last Post: 10-29-2006, 05:04 AM
  3. Replies: 3
    Last Post: 05-25-2005, 01:50 PM
  4. Small HTML question
    By Thantos in forum Tech Board
    Replies: 4
    Last Post: 12-29-2003, 12:37 AM
  5. Tetris Questions
    By KneeGrow in forum Game Programming
    Replies: 19
    Last Post: 10-28-2003, 11:12 PM