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.
この場合、一時的な文字列の使用を避ける方法があるかどうか疑問に思っています:
tempString = inputString.substr(commaLast,commaCurrent-1); yPos = strtod(tempString.c_str(), NULL);
最初に部分文字列を一時文字列に格納せずに substr コマンドを使用して c_str を返す方法はありません (元の文字列を変更したくない場合)。
次のことを試しましたか?
yPos = strtod(inputString.substr(commaLast,commaCurrent-1).c_str(), NULL);