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.
我需要更改字符串中的一个字符。在普通 C 中,这只需更改偏移量即可完成:
char string[]="Somestring"; string[1] = 'a'; //"Samestring"
但在 NXC 中不支持此类操作。那么如何更改字符串偏移量的字符。NXC 关于他们的字符串的文档有 3 行,所以我现在很无奈。
你可以这样做:
string foo = "Somestring"; foo[2] = 'a'; // results in "Samestring"