错误:无效的预处理指令#i是指#if吗?
我正在学习CPP并在使用CodeBlocks IDLE时遇到此错误。
它不会运行。
#include <iostream>
// using switch statements
using namespace std;
const float fac = 2.54;
float x , in,cm;
char ch = 0;
int main(){
switch (ch) {
case 'i':
in=x;
cm=x/fac;
break;
case 'c':
in = x/fac;
cm =x;
break;
default:
in=cm=0;
break;
}
}
最佳答案
只需将粘贴从此页面复制回您的IDE。我的CodeBlocks执行此操作没有错误。
我没有足够的特权发表评论。
关于c++ - 错误: Invalid preproccessing directive #i did you mean #if?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62776090/