Note MAX is #define MAX 100
What im trying to do is reading the user's input and placing them into the string( the same string).
The input is ended by doing the End of File(EOF) Which DOS is ctrl+z.
Yet when i run the program and print the string.
It doesnt print the first input i typed.
Also is this the proper way to read input into string?
Example:
Blah
power
X
^z
power
x
And hints info whatever will helpCode:int main() { int i = 1, valid; char c, input[MAX]; c = getchar(); input[MAX] = c; for ( ; (c = getchar()) != EOF; i++){ input[i] = c; } input[i] = '\0'; printf("%s", input); return 0; }