最近遇到类似这样一个程序:

#include <iostream>
using namespace std;

#define MM(a, b) \
	if(a == 1) \
		{\
			b = 1; \
			return 0; \
		}

int main()
{
	int a = 1;
	int b = 2;

	MM(a, b);

	printf("test\n");   // add by me

	return 0;
}
       我加了printf函数后, 发现不生效, 导致重新定位、编译、部署、测试等, 至少浪费15分钟。

       原来MM中有return, oh my god




本文转载:CSDN博客