sscanf function Demo

Understand how sscanf function works in C programming language with the help of an example. Here we demonstrate sscanf function in C language. If you have any questions, do feel free to comment.

    #include<stdio.h>
    #include<conio.h>
    int main(){
    char *str = "Learn C Online";
    char *first, *second, *third;
    clrscr();
    sscanf(str,"%s %s %s", first, second, third);
    printf("%s",first);
    printf("\n%s",second);
    printf("\n%s",third);
    return 0;
}

Output:
Learn
C
Online

Also See:
Explanation on sscanf function

You may also like...

1 Response

Leave a Reply

Your email address will not be published. Required fields are marked *

FREE C Cheatsheet - Speed Up Your C Programming.

FREE C Cheatsheet - Speed Up Your C Programming.

Download a 7-page free cheat sheet for easy and quick access to C Concepts, Snippets, and Syntax.

Thank you! Check you inbox and access your cheat-sheet