- 博客(2)
- 资源 (3)
- 收藏
- 关注
原创 对于if ...else if .... 分支太多的问题
在移植一个项目代码从c 转换到 C++时, 有一个if ...else if 分支很多代码块, C编译器可以过, C++编译器不能够, 好像分支是超过200多时, 就不能编译过去了。网上也有一些方法,比如:把每个分支封装成一个函数, 当前一个分支执行完后调用另一个函数。但这样少的话,可以, 太多的话, 工作量也很大。我是这样做的,在每个else if 分支块的末尾,添加go to 语句,跳出这个if else if ...代码块, , 在我这个项目中,因为if ... else if .. 外层是
2010-09-29 14:23:00 2616 1
转载 解决Visual C++ 编译器中混合 .c 文件时收到 C1853 预编译头错误的方法
当项目中混合了 .cpp 和 .c 文件时,编译器会对它们采取不同的编译方式(主要是因为对函数声明的处理方式不同),因而不能共用一个预编译头文件。在 VC++ 中,默认的预编译头文件是针对 C++ 的 (stdafx.h 和 stdafx.cpp),当然也可以创建针对 C 的预编译头。
2010-09-25 10:08:00 732
tcc-0.9.25-win32-bin
2011-08-18
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人