Forum Discussion
Altera_Forum
Honored Contributor
12 years agoAARGGGG cin/cout are an order of magnitude worse.
Not quite as bad as the stringstream classes though. Use fgets(buf, sizeof buf, stdin) to read a line and parse it yourself - in this case that just means that you need to allow for the trailinf '\n'. Lighter weight is to use read(0, buf, sizeof buf) - but that relies on the device drive code to generate lines (which it may not do).