C专家编程_2.2

C专家编程_2.2
switch 的break 问题

network code()
{
	switch(line)
	{
		case THING1:
			doit1();
			break;
		case THING2:
			if(x == STUFF)
			{
				do_first_stuff();
				if(y == OTHER_STUFF)
					break;
				do_later_stuff();
			}   /*  代码意图是跳到这里  */
			initialize_mode_pointer();
			break;
		default:
			processing();		
	}  /*  实际上跳到了这里  */
	use_mode_pointer(); /* 致使mode_pointer 未初始化 */
}

猜你喜欢

转载自blog.csdn.net/Old_Zero/article/details/88087082