|
|
Valid input 16 Valid input -4 Valid input 8.54 Invalid input 8v Valid input 6 Valid input 127 Invalid input b |
PLEASE ALWAYS USE CODE TAGS (the <> formatting button), to the right of this box, when posting code. Along with the proper indenting it makes it easier to read your code and also easier to respond to your post. http://www.cplusplus.com/articles/jEywvCM9/ http://www.cplusplus.com/articles/z13hAqkS/ Hint: You can edit your post, highlight your code and press the <> formatting button. You can use the preview button at the bottom to see how it looks. I found the second link to be the most help. |
ifstream infile(argv[1], ios::in | ios::binary);
. The "ifstream" already says it is for input, so the "ios::in" is not needed. I have no idea why you think it should open in "binary" mode. It is just a plain text file of numbers. I have tried it both ways and saw no difference.