This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

NRF9160 zephyr os cannot use the sscanf

Dear All,

I am trying to use sscanf in a project and I am getting the message that it is undefined. I am including <stdio.h>.

I cannot understand/find the reason of the problem. The most similar question to mine I could find was this and it didn't address the sscanf isse

Parents Reply
  • I know this is too old ticket but,  I cant use sscanf for float numbers, even though I enabled

    CONFIG_NEWLIB_LIBC_FLOAT_PRINTF=y
    CONFIG_NEWLIB_LIBC_NANO=y

     

    but sscanf works ok for the Not a floating-point number

    char input[] = "23.98";
     float vald = 0;
     int num_parsed = sscanf(input, "%f", &vald);
    
    printk("Input: %s\n", input);
     printk("Parsed values: %f\n", (double)vald);
    printk("Number of values parsed: %d\n", num_parsed);
    
    
    
    return: 
    
    Input: 23.98
    Parsed values: 0.000000
    Number of values parsed: 0
Children
Related