• C++运算符总结,看这一篇就够了


    4 运算符

    OperatorAssoc.Meaning
    Precedence Group 1
    ::Scope resolution operator
    Precedence Group 2
    (expression)Grouping
    ()L–RFunction call
    ()Value construction—that is, type (expr)
    []Array subscript
    .Direct membership operator
    ->Indirect membership operator
    ++Increment operator, postfix
    Decrement operator, postfix
    const_castSpecialized type cast
    dynamic_castSpecialized type cast
    reinterpret_castSpecialized type cast
    static_castSpecialized type cast
    typeidType identification
    Precedence Group 3 (All Unary)
    !R–LLogical negation
    ~Bitwise negation
    +Unary plus (positive sign)
    -Unary minus (negative sign)
    ++Increment operator, prefix
    Decrement operator, prefix
    &Address
    *Dereference (indirect value)
    ()Type cast—that is, (type) expr
    sizeofSize in bytes
    alignofAlignment requirement
    newDynamically allocate storage
    new []Dynamically allocate array
    deleteDynamically free storage
    delete []Dynamically free array
    noexceptFalse if operand might throw an exception
    Precedence Group 4
    .*L–RMember dereference
    ->*Indirect member dereference
    Precedence Group 5 (All Binary)
    *L–RMultiply
    /Divide
    %Modulus (remainder)
    Precedence Group 6 (All Binary)
    +L–RAddition
    -Subtraction
    Precedence Group 7
    <<L–RLeft shift
    >>Right shift
    Precedence Group 8
    <L–RLess than
    <=Less than or equal to
    >=Greater than or equal to
    >Greater than
    Precedence Group 9
    ==L–REqual to
    !=Not equal to
    Precedence Group 10 (Binary)
    &L–RBitwise AND
    Precedence Group 11
    ^L–RBitwise XOR (exclusive OR)
    Precedence Group 12
    |L–RBitwise OR
    Precedence Group 13
    &&L–RLogical AND
    Precedence Group 14
    ||L–RLogical OR
    Precedence Group 15
    :?R–LConditional
    Precedence Group 16
    =R–LSimple assignment
    *=Multiply and assign
    /=Divide and assign
    %=Take remainder and assign
    +=Add and assign
    -=Subtract and assign
    &=Bitwise AND and assign
    ^=Bitwise XOR and assign
    |=Bitwise OR and assign
    <<=Left shift and assign
    >>=Right shift and assig
    Precedence Group 17
    throwL–RThrow exception
    Precedence Group 18
    ,L–RCombine two expressions into one

    README

    此为本人读C++ Primer总结的笔记,如有错误或知识缺口,请在评论区告知。如本文有在实践中帮到您,是本人的荣幸。

  • 相关阅读:
    内核进程的调度与进程切换
    我的创作纪念日
    集合类ArrayList的扩容机制详解
    dumpsys meminfo 详解
    Go-知识map
    四、线程安全问题以及锁的概念
    【2023】Redis服务器与客户端操作
    个人实现在线支付,一种另类的在线支付解决方案
    Flex and Bison 阅读与学习笔记
    vscode前端常用插件
  • 原文地址:https://blog.csdn.net/weixin_44410704/article/details/127792740