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(mystr, "R: %f", &myFloat);
sscanf固定形式の単純な文字列を解析するのに適しています。
sscanf