I have tried to implement the puts function.It in actual returns a value but i cant get what should it return.please check my code and guide me further
/* implementation of puts function */
#include<stdio.h>
#include<conio.h>
void puts(string)
{
int i;
for(i=0; ;i++)
{
if(string[i]=='\0')
{
printf("\n");
break;
}
printf("%c",string[i]);
}
}
See comments in code.
And, as an aside – I’ve written the equivalent of putc, puts several different times in relation to developing on embedded systems. So it’s not always just a learning exercise. 🙂
Comment on EOF: It is a POSIX constant from stdio.h.
In my Linux stdio.h, I have this definition:
That definition code is GPL 2.1.