Sorry, getting somewhat off-topic.PrintF vs cout?
My memory might be failing me though.
The graduate was initializing the string variable with: char *text = ""; and then trying to strcpy to it. He was a quick learner but that was the first time I'd been confronted by a programming language having abstracted away some memory management details. It took me a long time to trust the Java garbage collector but my turning point was finding out how the Java generations and survivor spaces are handled.
For those who don't know C so well: A string had to be initialized by allocating memory to the variable. Any string operations had to make sure they didn't write past the end of the allocated memory, something you could get wrong, resulting in a buffer overflow.
Last edited:

