a) sscanf () The sscanf () function allows to read characters from a character array and writes them
to another array.
This function is similar to scanf () but instead from standard input it reads data from an array.
7.40 Write a program to read string from a character array.
# include <stdio.h>
# include <canio.h>
void main ()
{
char in[10] ,out[10];
clrscr ();
gets(in);
sscanf (in,”%s"j>ut);
printf ("%s\n",out);
}
QVmiL
HELLO
HELLO
ExplanationIn the above program two character arrays in [10] and out [10] are declared. Thegets
() function reads
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.