@GratefullyDead "the snippet here that really matters" No. If you do not understand what is going on, and you obviously don't, then you don't know what really matters. Sometimes the particular header files used are very important. Variable declarations are extremely important. For example your code snippet uses
file.txt
in the read call, which we all KNOW is completely wrong.