c - 我如何将 ' 视为普通字母
问题描述
else if (isspace(text[i]) || (text[i]) == ')
{
words++;
}
在终端中显示:“错误:缺少终止字符 [-Werror,-Winvalid-pp-token]”。
解决方案
单个字符由'
围绕它们的单引号 ( ) 表示,甚至是'
字符本身 - 尽管您需要使用反斜杠 ( \
) 对其进行转义:
else if (isspace(text[i]) || (text[i]) == '\'')
{
words++;
}
推荐阅读
- r - 如何将变量作为 SQL Server 2016 R 服务的输出返回?
- sql - 从多个表中选择,消除重复值
- ios - Swift Firebase - 如何验证“PhoneAuthCredential”并保持用户当前使用他们当前的电子邮件 uid 登录
- amazon-web-services - 将数据传输到 Amazon Workspaces
- pandas - Pandas groupby agg/apply 对组中的不同行具有不同的功能
- javascript - 动画只有一个 div 不是全部
- microsoft-graph-api - AAD 服务主体作为组所有者
- azure-active-directory - 无法使用用户名和密码获取 Microsoft Graph API OAuth 2.0 的 access_token
- c# - SqlDependency - 清理 Started_Outbound 对话
- eclipse - 如何使用 Gradle 构建 Xtext Eclipse 插件?