(pGlobals->pAccount->Flags & MINI_AUTO_LOGON) ? 1 : 0其中,Flags            是DWORD类型, 
      MINI_AUTO_LOGON  是常量,值为16。两个值相与后怎么会是一个布尔类型呢?请解释并翻译,谢谢!

解决方案 »

  1.   

    if pGlobals.pAccount.Flags and MINI_AUTO_LOGON then
      1
    else
      0
      

  2.   

    &位与进行&操作后的数是0还是非00就是false
    1就是true
      

  3.   

    to  chijingde(AD)
    >>>if pGlobals.pAccount.Flags and MINI_AUTO_LOGON then
    不能这样做,按你的解释就是说可以这样翻译:
    原句:
    CheckDlgButton(hDlg, IDD_AUTO_LOGON, 
      (pGlobals->pAccount->Flags & MINI_AUTO_LOGON) ? 1 : 0 );
    译句:
    CheckDlgButton(hDlg, IDD_AUTO_LOGON, BOOL(pGlobals.pAccount.Flags and MINI_AUTO_LOGON));
      

  4.   

    (pGlobals->pAccount->Flags & MINI_AUTO_LOGON) ? 1 : 0
    if (pGlobals.pAccount.Flags and MINI_AUTO_LOGON = true then result=  1 else result= 0
      

  5.   

    这是C++的问题语句,并不推荐这样用~~~~~~~`
    推荐的写法(现代的):(pGlobals->pAccount->Flags & MINI_AUTO_LOGON)==0 ? 0 : 1
      

  6.   

    if (pGlobals.pAccount.Flags and MINI_AUTO_LOGON = true then result=  1 else result= 0
    错了:-)
    if (pGlobals.pAccount.Flags and MINI_AUTO_LOGON) >0 then result=  1 else result= 0
      

  7.   

    好,谢谢两位,按此说来,
    BOOL(...)也是对的。