I'm having a little problem:
For an assignment I have to write a program which basically converts 8 bit binary numbers to ASCII and outputs the assembled text. Here's the catch:
The 8-bit binary numbers are provided by some external file (which only contains 8 bit binary numbers); the name and hence length is not known. The external file is called with a pointer upon execution
(./"conversion program" < external_file.in).
I'm getting the 8 bits as a string, calculate/convert decimals, output char type. HOW do I know when to stop the loop? If I just pick an insanely high number I get random stuff at the end; no boundaries obviousely lead to an infinite loop.
Can I determine the lenght of this random ext file somehow nonetheless?
Is it possible to create a vector which dinamically adjusts itself until there are no more strings = end of the file?
I'll restate the problem: I don't know the external file. It could be named newspaper.in or protestor_sign.in or anything else...I only know they'll all contain nothing but binary numbers