Checking for an "end of line" in a C-string
- by Numerator
I would really love your help with the following problem:
I want to get as an input from the user a maximum length of 30 chars string and check whether it contains an end of line.
This is what I tried to write so far:
int main(void) {
int i;
char* command = (char*)calloc(31, sizeof(char));
while (0 < 1) {
scanf("%s", command);
for (i…