Original Post
Hello, I am using sscanf function in c++. I am unable to understand completely how it functions. I am reading some values from a string using sscanf. However, I am not getting the desired result. Let me show some examples, sscanf(row, "%s%f%*[ \t]%c%*[ \t]%f%s", &label, &low, &dummy, &high, &unit); The above line works fine when 'row' string is "AF 870 - 950Mhz", ie it fill as follows, label = AF low = 870 dummy = '-' high = 950 unit = Mhz However, in case where 'row' string is "AF 870-950Mhz", it doesn't read correctly. Can you please tell me what is wrong with my code. It seems that my understanding of this function is not correct. Thank you Best Regards.