Hi everyone,
I am a newbie in C programming.
I have to make an implementation of gets() function from stdio.h, but I am not sure where to start.
Please advice, any help is welcome.
Thank you,
Brian.
Printable View
Hi everyone,
I am a newbie in C programming.
I have to make an implementation of gets() function from stdio.h, but I am not sure where to start.
Please advice, any help is welcome.
Thank you,
Brian.
Use getchar() and a loop.
Though modelling fgets() would be a better idea.
fgets() is indeed better. I don't know what you meant by not using stdio.h . I would actually be interested in seeing that.
Nah. std is for standard, io is for input/output. C all by itself does not include this, so without stdio.h you cannot access any input, and you cannot produce any output.
Programs which do not include stdio are possible, but beyond just clocking time on the processor they don't have any purpose.
ifaTreeFallsintheForest.c
Code:int main() {
int i = 100;
char buffer[] = "can you hear me now?";
while (i > 0) {
[ do things with variables ]