@Lorand Yes, using
getopt
would be better (collect
-e
operands in a data structure of some kind). Overall this question isn't really suited for Stack Overflow, as it is asking for improvements / refactoring to a functional program. I'll hesitantly suggest
codereview.stackexchange.com, but you will want to frame your question more clearly, and improve your understanding of your own code, as they generally expect higher quality submissions than SO. Alternatively, try rephrasing this question to focus in on your misunderstanding of
getline
breaking up lines (which it does not). —
Oka 38 secs ago