c - my c program con't go ahead (only scanf and printf in it)
问题描述
Thread 1: EXC_BAD_ACCESS (code=1, address=0x25630a) this is my first time use xcode and learn c. I just want to scanf a lowercase letter and change it into an uppercase letter. but I can't stop my program and don't know what happend now.
int main () {
char ch;
scanf("%c", &ch);
ch = ch - 32;
printf('%c\n', ch);
return 0;
}
解决方案
int main () {
char ch;
scanf("%c", &ch);
ch = ch - 32;
printf("%c\n", ch);
return 0;
}
哦,这是我的代码。我把它放在这里,不需要看图。
我知道我有什么错误, c 不能使用单引号
谢谢
推荐阅读
- c# - 用数组更新标签
- django - Django:使用 GET 将额外的变量传递给 LoginView?
- python - 如何循环返回网页抓取结果并保存到 Excel 文件?
- asp.net-core - 使用 AutoMapper 进行多对多关系展平
- c# - C# Telegram.Bot SendTextMessageAsync 不发送任何消息
- c# - 如何在 C++ 非托管代码中反序列化 byte[] 的 json 字符串为 Json?
- c++ - std::condition_variable 对系统时钟敏感
- firefox - 我可以停止显示 Firefox webRTC 共享指示器吗?
- laravel - laravel 路由问题?
- python - 在 Brython 中使用 cookie