Pages

Friday, 9 February 2018

Write down two functions xgets( ) and xputs( ) which work similar to the standard library functions gets( ) and puts( ).


Write down two functions xgets( ) and xputs( ) which work similar to the standard library functions gets( ) and puts( ).
#include<stdio.h>

void xgets(char *str)
{
                scanf("%[^\n]s", str);
}

void xputs(char *str)
{
                printf("%s\n", str);
}