__isoc99_sscanf

#include <stdio.h>

int main() {
    char input[] = "42 3.14 Hello";
    int integer;
    float floating_point;
    char string[10];

    int result = __isoc99_sscanf(input, "%d %f %s", &integer, &floating_point, string);

    printf("Result: %d\n", result);
    printf("Integer: %d\n", integer);
    printf("Floating Point: %f\n", floating_point);
    printf("String: %s\n", string);

    return 0;
}

Explanation:

  1. Include the necessary header file for standard input and output operations (stdio.h).

  2. Define the main function, which is the entry point of the program.

  3. Declare a character array input containing the string "42 3.14 Hello".

  4. Declare variables integer of type int, floating_point of type float, and string of type character array (char).

  5. Declare a variable result of type int to store the return value of __isoc99_sscanf.

  6. Use __isoc99_sscanf to parse the input string according to the specified format. The format string "%d %f %s" indicates that the function should expect an integer, a floating-point number, and a string in the input string.

  7. Pass the addresses of variables integer, floating_point, and string as arguments to __isoc99_sscanf so that the parsed values can be stored in these variables.

  8. Print the result of the scanning operation using printf.

  9. Print the values stored in the variables integer, floating_point, and string using printf.

  10. Return 0 to indicate successful execution of the program.