I want to read a text from the input in a line by line manner, and not read any line that starts with 'a', then store the remaining text in an array. I am not sure how to do this since my program terminates reading just the first line of the text. Lets say the text is:
hello world \n a hello world \n hello world'
Then my output should be:
hello world \n hello world
char line[1000];
int line_len = 0;
while ((c = getchar()) != '\n'){
line[line_len++] = c;
}
return 0;