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.
文字列の 1 文字を変更する必要があります。通常の C では、オフセットを変更するだけでこれを実行できます。
char string[]="Somestring"; string[1] = 'a'; //"Samestring"
ただし、NXC では、このような操作はサポートされていません。では、文字列オフセットの文字を変更するにはどうすればよいですか。文字列に関するNXCのドキュメントには3行あるので、今はとても無力です。
次のように実行できます。
string foo = "Somestring"; foo[2] = 'a'; // results in "Samestring"