zoukankan      html  css  js  c++  java
  • C 语言中的优先级

    先看一段代码:

     1 /*********************************************************************
     2  * @fn      bdAddr2Str
     3  *
     4  * @brief   Convert Bluetooth address to string. Only needed when
     5  *          LCD display is used.
     6  *
     7  * @return  none
     8  */
     9 char *bdAddr2Str( uint8_t *pAddr )//ownMacAdd[6]
    10 {
    11 #define B_ADDR_STR_LEN    15
    12 
    13   uint8_t     i;
    14   char        hex[] = "0123456789ABCDEF";
    15   static char str[B_ADDR_STR_LEN];
    16   char        *pStr = str;
    17 
    18   *pStr++ = '0';
    19   *pStr++ = 'x';
    20 
    21   // Start from end of addr
    22   pAddr += B_ADDR_LEN;
    23 
    24   for ( i = B_ADDR_LEN; i > 0; i-- )
    25   {
    26     *pStr++ = hex[*--pAddr >> 4];
    27     *pStr++ = hex[*pAddr & 0x0F];
    28   }
    29 
    30   *pStr = 0;
    31 
    32   return str;
    33 }

    看到这段代码,我首先就想到了优先级。经过测试得出优先级为:

    *优先级大于 --、++的优先级。

    当你坚持做一件完全正确的事情,有可能在很长一段时间内,你的价值都是零。
  • 相关阅读:
    ansible 批量在远程主机上执行命令
    SQLAlchemy
    operator, itertools
    mongodb基础语法
    django model Meta选项
    __getattr__,settr
    django的contenttype表
    time和datetime和tzinfo
    全局钩子的改名
    dom中文字居中
  • 原文地址:https://www.cnblogs.com/lweleven/p/4883185.html
Copyright © 2011-2022 走看看