Neither. This loop does what you want:Originally Posted by transgalactic2
Code:for (i = 0; i < 39 && (ch = getchar()) != '\n' && ch != EOF; ++i) { input[i] = ch; } input[i] = '\0';
Neither. This loop does what you want:Originally Posted by transgalactic2
Code:for (i = 0; i < 39 && (ch = getchar()) != '\n' && ch != EOF; ++i) { input[i] = ch; } input[i] = '\0';
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)