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.
简单的问题。
如何检查 LPCSTR 上第一个位置上的字符是什么?
或者只是检查第一个位置是否有空格?
给定一个名为 的 LPCSTR str,您可以使用 访问第一个字符str[0]。例如:
str
str[0]
if (str[0] == ' ') { // First character is a space }