Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有以下格式的字符串:“R:625.5m E:-32768m”
拔出 625.5 最有效的方法是什么?
sscanf是解析具有固定格式的简单字符串的好候选。
sscanf
最好的办法是使用sscanf从字符串中读取格式化信息。
sscanf(mystr, "R: %f", &myFloat);