Quantcast
Channel: stardot.org.uk
Viewing all articles
Browse latest Browse all 3544

programming • Re: whats wrong with this simple code?

$
0
0
Going back to the "print the last 7 entries" question, another solution would be to use a 7-string array and fill it in a circular fashion, so that the eighth entry overwrites the first, and the ninth overwrites the second, and so on. This seems much better than reading the whole file twice, and perhaps simpler (and certainly faster) than shuffling data around in the array every time a line is read.
Yup, simple, easy and fast.

I saw the question and was surprised at the strange collection of responses. A large number of programming folk failed the Google recruitment "follow the white rabbit down the hole" set of tasks simply because they didn't read the instructions thoroughly.

Statistics: Posted by maniacminer — Mon Dec 02, 2024 2:32 am



Viewing all articles
Browse latest Browse all 3544

Latest Images

Trending Articles



Latest Images