I am trying to read the user's input. When I compile the program I get the message, 'control reaches end of non-void function [-Wreturn-type] }'.
char *read_line(char *buf, size_t sz) {
while(fgets(buf, sz, stdin)) {
fputs(buf, stdout);
}
}
int main(int argc, char** argv) {
char *buf;
read_line(buf, 1024);
}
I want the program to take the user's input, press enter, and have their input printed back out to them. I gotta do it using the methods I have used (it's part of some homework).
I don't fully know what is going on under the hood of C, so it is just causes some many problems like this :).