Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

char buf[LINE_MAX]

Name: Anonymous 2008-08-26 6:39

Why do programmers still code in arbitrary limits like these?

It breaks when you do
#define LINE_MAX UINT_MAX

Why not redesign so that you use an O(1) space algorithm, or if it can't be avoided, dynamically allocate as much as needed?

Name: Anonymous 2008-08-26 23:02

I claim that if your text file has 'lines' over 4096 bytes, maybe it's time to think of a better way to parse it.
OP here, read the last line of the post --- but what if "parsing it" entails needing the entire line and there is no O(1) space algorithm that exists?

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List