The definition of a minimum console width by the C & C++
The definition of a minimum console width by the C & C++
..
Last edited by Perica on Tue Dec 05, 2006 9:36 pm, edited 1 time in total.
Re:The definition of a minimum console width by the C &
C/C++ do not require a console, and as such a minimum width wouldn't make sense. They just require that there be stdin/stdout/stderr (or cin/cout/cerr for C++) for standard input and output. There nothing to say that stdin couldn't be a card-punch and stdout a speaker signalling morse-codes.
Besides, since we aren't requiring any physical properties from either, there definitely isn't any requirement for characters to be fixed-width. As far as C/C++ is concerned, you are perfectly free to use a variable-width font, in which case "maximum number of characters" no longer makes any sense, and you'd have to specify the number of pixels, which font (and font size) is used, what all the font metrics are, whether we use kerning, what kind of hinting process do we have, and loads of other stuff...
That said, while C/C++ standards have nothing to do with this, for practical console applications it is usually safe to assume 80 (or 78 to be safe) characters per line minimum. Those who have less usually know what they are doing.
Besides, since we aren't requiring any physical properties from either, there definitely isn't any requirement for characters to be fixed-width. As far as C/C++ is concerned, you are perfectly free to use a variable-width font, in which case "maximum number of characters" no longer makes any sense, and you'd have to specify the number of pixels, which font (and font size) is used, what all the font metrics are, whether we use kerning, what kind of hinting process do we have, and loads of other stuff...
That said, while C/C++ standards have nothing to do with this, for practical console applications it is usually safe to assume 80 (or 78 to be safe) characters per line minimum. Those who have less usually know what they are doing.