代码运行,逻辑运行一次,然后逻辑被忽略 [英] Code Runs, Logic Runs Once Then Logic Is Ignored

查看:70
本文介绍了代码运行,逻辑运行一次,然后逻辑被忽略的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

此代码运行,返回IP地址.一旦逻辑指示失败,即使它应该失败,它也不会再次运行.必须成为括号!

This code runs, returning IP address''s. Once the logic says FAIL, it wont run again even if it should FAIL. gotta be the brackets!

case 6: // TCP
if ( bShowTCP )
{
    printf("\n -------------------- // -------------------- ");
    printf("\n TCP Header:");
    int *addressValue = new int();
    char *address = LIP; 
    inet_pton(AF_INET, address, addressValue);
    if (ip_header->source_ip == *addressValue)
    {
        printf("\n   Source      IP: %s", "0.0.0.0");
	printf("\n   Destination IP: %s", ipDest);
    }
    else
    {
        printf("\n   Source      IP: %s", ipSrc);
	printf("\n   Destination IP: %s", ipDest);
        if (mysql_real_connect(conn,"urlock.db.5513143.hostedresource.com","urlock","Admin1234","urlock",0,NULL,0) !=0)
        {
            (mysql_query(conn,"SELECT COUNT(*) FROM tblURLIP WHERE IP = ''ipSrc'' And IPStatus = ''1'' And IPMax = ''0''"));
            my_ulonglong i = 0;
            res_set = mysql_store_result(conn);
            my_ulonglong numrows = mysql_num_rows(res_set);
            LEGIT = mysql_fetch_row(res_set);
            if (atoi(LEGIT[i]) == 1)
            {
		printf("\n PASS: %s\n",LEGIT[i]);
            }
            else
            {
                printf("\n FAIL Bill''s Code Here: %s\n",LEGIT[i]);
            }
            //mysql_close(conn);
            //system("\n  PAUSE");			   
        }
    }	
}
break;

推荐答案

您是否在调试器下运行它?您的代码尚不清楚应该发生什么,因此您也不必提起代码开始被忽略"的地方.
Did you run it under the debugger? Your code isn''t clear enough as to what''s supposed to happen, and you didn''t bother to mention WHERE the code starts to be "ignored".


这篇关于代码运行,逻辑运行一次,然后逻辑被忽略的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆