本文介绍了如果声明没有意义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个if语句的最后一个语句对我来说没有意义还是对?

The last statement of this if statement isn''t making sense to me or does it?

   // Check arguments
   if ( _argc > 1 )
   {
      if ( !_stricmp(_argv[1], "icmp") )
{ //<-- Need to add brackets for more than one statement
   bShowTCP = FALSE;
   bShowUDP = FALSE;
}
else if ( !_stricmp(_argv[1], "tcp") )
{
   bShowUDP = FALSE;
   bShowICMP = FALSE;
}
else if ( !_stricmp(_argv[1], "udp") )
{
   bShowTCP = FALSE;
   bShowICMP = FALSE;
}
else
{
   bShowUDP = TRUE; //<-- Needs to be within else statement brackets
   printf( "\nUsage lsniff [ICMP|TCP|UDP]\n" );
   exit(0); //<-- FYI... this ends execution of the program

}
   }

推荐答案




这篇关于如果声明没有意义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-22 17:00