I'd like a function to process what a user enters, filter it, and return the resulting string to whichever function called it.
Can this work without declaring an global variable like the one below?
#include <stdio.h>
char entry[12]; // globals aren't appealing!
char *read_entry() {
scanf("%s",entry);
return entry;
}
int main(void) {
printf("%s",read_entry());
}