{"id":1201,"date":"2023-02-18T18:40:34","date_gmt":"2023-02-18T18:40:34","guid":{"rendered":"https:\/\/hugohabor.com\/?p=1201"},"modified":"2023-03-02T14:13:26","modified_gmt":"2023-03-02T14:13:26","slug":"c-precedence-and-associativity","status":"publish","type":"post","link":"https:\/\/hugohabor.com\/?p=1201","title":{"rendered":"C++ Precedence And Associativity"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u7576\u4f60\u6709\u7b97\u6578\u7684\u7d93\u9a57\u6642\uff0c\u4f60\u6703\u77e5\u9053\u5728\u505a\u56db\u5247\u904b\u7b97\u6642\u6703\u6709\u5148\u4e58\u9664\u5f8c\u52a0\u6e1b\u7684\u898f\u5247<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u7a0b\u5f0f\u7576\u7136\u4e5f\u6709\uff0cC++ \u88e1\u9762\u4e5f\u6709\u76f8\u95dc\u7684\u5148\u5f8c\u9806\u5e8f\u8207\u95dc\u806f\u6027<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/en.cppreference.com\/w\/cpp\/language\/operator_precedence\" target=\"_blank\" rel=\"noreferrer noopener\">C++ Precedence and associativity <\/a><\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u5148\u524d\u89c0\u5ff5<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">What is the purpose of {} in C++?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">{} can be used to&nbsp;<strong>initialise variables<\/strong>&nbsp;in C++11 in the same way that they are used to initialise arrays and structures in C.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">{} \u53ef\u7528\u65bc\u5c07C++ \u5df2\u5ba3\u544a\u7684\u8b8a\u6578\u505a<strong> \u521d\u59cb\u503c\u4ee3\u5165\u3002<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u7bc4\u4f8b01<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;iostream&gt;\n\n\nint main(){\n\n\/\/\u521d\u59cb\u503c\u4ee3\u5165\n    int a {6};\n    int b {3};\n    int c {8};\n    int d {9};\n    int e {3};\n    int f {2};\n    int g {5};\n        \n    int result = a + b * c -d\/e -f + g; \/\/  6 +  24  -   3 - 2 + 5\n    \n    std::cout &lt;&lt; \"result : \" &lt;&lt; result &lt;&lt; std::endl;\n\n    system(\"pause\");\n\n    return 0;\n}\n\n\/\/\u7d50\u679c:  6 +  24  -   3 - 2 + 5 = 30<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">\u7bc4\u4f8b02<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;iostream&gt;\n\n\nint main(){\n\n    int a {6};\n    int b {3};\n    int c {8};\n    int d {9};\n    int e {3};\n    int f {2};\n    int g {5};\n        \n    int result = a + b * c -d\/e -f + g; \/\/  6 +  24  -   3 - 2 + 5\n    \n    std::cout &lt;&lt; \"result : \" &lt;&lt; result &lt;&lt; std::endl;\n\n    result = a\/b*c +d - e + f;  \/\/   16 + 9 - 3 + 2\n    std::cout &lt;&lt; \"result : \" &lt;&lt; result &lt;&lt; std::endl;\n\n    system(\"pause\");\n\n    return 0;\n}\n\n\/\/\u7d50\u679c:  6 +  24  -   3 - 2 + 5 = 30\n\/\/\u7d50\u679c:   16 + 9 - 3 + 2 =24<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u7576\u4f60\u6709\u7b97\u6578\u7684\u7d93\u9a57\u6642\uff0c\u4f60\u6703\u77e5\u9053\u5728\u505a\u56db\u5247\u904b\u7b97\u6642\u6703\u6709\u5148\u4e58\u9664\u5f8c\u52a0\u6e1b\u7684\u898f\u5247 \u7a0b\u5f0f\u7576\u7136\u4e5f\u6709\uff0cC++ \u88e1\u9762\u4e5f\u6709\u76f8\u95dc\u7684\u5148\u5f8c\u9806\u5e8f\u8207\u95dc\u806f\u6027 C++ Precedence and associativity \u5148\u524d\u89c0\u5ff5 What is the purpose of {} in C++? {} can be used to&nbsp;initialise variables&nbsp;in C++11 in the same way that they are used to initialise arrays and structures in C. {} \u53ef\u7528\u65bc\u5c07C++ \u5df2\u5ba3\u544a\u7684\u8b8a\u6578\u505a \u521d\u59cb\u503c\u4ee3\u5165\u3002 \u7bc4\u4f8b01 \u7bc4\u4f8b02<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","_eb_attr":"","WB4WB4WP_MODE":"","WB4WP_PAGE_SCRIPTS":"","WB4WP_PAGE_STYLES":"","WB4WP_PAGE_FONTS":"","WB4WP_PAGE_HEADER":"","WB4WP_PAGE_FOOTER":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[60],"tags":[61,59],"class_list":["post-1201","post","type-post","status-publish","format-standard","hentry","category-cpp-c-coding","tag-cpp","tag-operator-precedence"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.4 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u7576\u4f60\u6709\u7b97\u6578\u7684\u7d93\u9a57\u6642\uff0c\u4f60\u6703\u77e5\u9053\u5728\u505a\u56db\u5247\u904b\u7b97\u6642\u6703\u6709\u5148\u4e58\u9664\u5f8c\u52a0\u6e1b\u7684\u898f\u5247 \u7a0b\u5f0f\u7576\u7136\u4e5f\u6709\uff0cC++ \u88e1\u9762\u4e5f\u6709\u76f8\u95dc\u7684\u5148\u5f8c\u9806\u5e8f\u8207\u95dc\u806f\u6027 C++ Precedence and associativity \u5148\u524d\u89c0\u5ff5 What is the purpose of {} in C++? {} can be used to initialise variables in C++11 in the same way that they are used to initialise arrays and structures in C. {} \u53ef\u7528\u65bc\u5c07C++ \u5df2\u5ba3\u544a\u7684\u8b8a\u6578\u505a \u521d\u59cb\u503c\u4ee3\u5165\u3002 \u7bc4\u4f8b01 #include int main(){ \/\/\u521d\u59cb\u503c\u4ee3\u5165 int a {6}; int b {3}; int\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"lioajimzen\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/hugohabor.com\/?p=1201\" \/>\n\t\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.4\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Hugo Habor -\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"C++ Precedence And Associativity - Hugo Habor\" \/>\n\t\t<meta property=\"og:description\" content=\"\u7576\u4f60\u6709\u7b97\u6578\u7684\u7d93\u9a57\u6642\uff0c\u4f60\u6703\u77e5\u9053\u5728\u505a\u56db\u5247\u904b\u7b97\u6642\u6703\u6709\u5148\u4e58\u9664\u5f8c\u52a0\u6e1b\u7684\u898f\u5247 \u7a0b\u5f0f\u7576\u7136\u4e5f\u6709\uff0cC++ \u88e1\u9762\u4e5f\u6709\u76f8\u95dc\u7684\u5148\u5f8c\u9806\u5e8f\u8207\u95dc\u806f\u6027 C++ Precedence and associativity \u5148\u524d\u89c0\u5ff5 What is the purpose of {} in C++? {} can be used to initialise variables in C++11 in the same way that they are used to initialise arrays and structures in C. {} \u53ef\u7528\u65bc\u5c07C++ \u5df2\u5ba3\u544a\u7684\u8b8a\u6578\u505a \u521d\u59cb\u503c\u4ee3\u5165\u3002 \u7bc4\u4f8b01 #include int main(){ \/\/\u521d\u59cb\u503c\u4ee3\u5165 int a {6}; int b {3}; int\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/hugohabor.com\/?p=1201\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/hugohabor.com\/wp-content\/uploads\/2023\/04\/274991094_1520511498332602_3929754424052866637_n.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/hugohabor.com\/wp-content\/uploads\/2023\/04\/274991094_1520511498332602_3929754424052866637_n.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"960\" \/>\n\t\t<meta property=\"og:image:height\" content=\"960\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2023-02-18T18:40:34+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2023-03-02T14:13:26+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"C++ Precedence And Associativity - Hugo Habor\" \/>\n\t\t<meta name=\"twitter:description\" content=\"\u7576\u4f60\u6709\u7b97\u6578\u7684\u7d93\u9a57\u6642\uff0c\u4f60\u6703\u77e5\u9053\u5728\u505a\u56db\u5247\u904b\u7b97\u6642\u6703\u6709\u5148\u4e58\u9664\u5f8c\u52a0\u6e1b\u7684\u898f\u5247 \u7a0b\u5f0f\u7576\u7136\u4e5f\u6709\uff0cC++ \u88e1\u9762\u4e5f\u6709\u76f8\u95dc\u7684\u5148\u5f8c\u9806\u5e8f\u8207\u95dc\u806f\u6027 C++ Precedence and associativity \u5148\u524d\u89c0\u5ff5 What is the purpose of {} in C++? {} can be used to initialise variables in C++11 in the same way that they are used to initialise arrays and structures in C. {} \u53ef\u7528\u65bc\u5c07C++ \u5df2\u5ba3\u544a\u7684\u8b8a\u6578\u505a \u521d\u59cb\u503c\u4ee3\u5165\u3002 \u7bc4\u4f8b01 #include int main(){ \/\/\u521d\u59cb\u503c\u4ee3\u5165 int a {6}; int b {3}; int\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/hugohabor.com\/wp-content\/uploads\/2023\/04\/274991094_1520511498332602_3929754424052866637_n.jpg\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BlogPosting\",\"@id\":\"https:\\\/\\\/hugohabor.com\\\/?p=1201#blogposting\",\"name\":\"C++ Precedence And Associativity - Hugo Habor\",\"headline\":\"C++ Precedence And Associativity\",\"author\":{\"@id\":\"https:\\\/\\\/hugohabor.com\\\/?author=1#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/hugohabor.com\\\/#organization\"},\"datePublished\":\"2023-02-18T18:40:34+00:00\",\"dateModified\":\"2023-03-02T14:13:26+00:00\",\"inLanguage\":\"en-US\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/hugohabor.com\\\/?p=1201#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/hugohabor.com\\\/?p=1201#webpage\"},\"articleSection\":\"CPP, CPP, Operator Precedence\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/hugohabor.com\\\/?p=1201#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/hugohabor.com\\\/#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/hugohabor.com\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/hugohabor.com\\\/?cat=60#listItem\",\"name\":\"CPP\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/hugohabor.com\\\/?cat=60#listItem\",\"position\":2,\"name\":\"CPP\",\"item\":\"https:\\\/\\\/hugohabor.com\\\/?cat=60\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/hugohabor.com\\\/?p=1201#listItem\",\"name\":\"C++ Precedence And Associativity\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/hugohabor.com\\\/#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/hugohabor.com\\\/?p=1201#listItem\",\"position\":3,\"name\":\"C++ Precedence And Associativity\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/hugohabor.com\\\/?cat=60#listItem\",\"name\":\"CPP\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/hugohabor.com\\\/#organization\",\"name\":\"Hugo Habor\",\"url\":\"https:\\\/\\\/hugohabor.com\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/hugohabor.com\\\/?author=1#author\",\"url\":\"https:\\\/\\\/hugohabor.com\\\/?author=1\",\"name\":\"lioajimzen\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/hugohabor.com\\\/?p=1201#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5e05b09ba406383ee0db1294db14a85fc4351ecd5ad2d7ab030e112459281aec?s=96&d=mm&r=g\",\"width\":96,\"height\":96,\"caption\":\"lioajimzen\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/hugohabor.com\\\/?p=1201#webpage\",\"url\":\"https:\\\/\\\/hugohabor.com\\\/?p=1201\",\"name\":\"C++ Precedence And Associativity - Hugo Habor\",\"description\":\"\\u7576\\u4f60\\u6709\\u7b97\\u6578\\u7684\\u7d93\\u9a57\\u6642\\uff0c\\u4f60\\u6703\\u77e5\\u9053\\u5728\\u505a\\u56db\\u5247\\u904b\\u7b97\\u6642\\u6703\\u6709\\u5148\\u4e58\\u9664\\u5f8c\\u52a0\\u6e1b\\u7684\\u898f\\u5247 \\u7a0b\\u5f0f\\u7576\\u7136\\u4e5f\\u6709\\uff0cC++ \\u88e1\\u9762\\u4e5f\\u6709\\u76f8\\u95dc\\u7684\\u5148\\u5f8c\\u9806\\u5e8f\\u8207\\u95dc\\u806f\\u6027 C++ Precedence and associativity \\u5148\\u524d\\u89c0\\u5ff5 What is the purpose of {} in C++? {} can be used to initialise variables in C++11 in the same way that they are used to initialise arrays and structures in C. {} \\u53ef\\u7528\\u65bc\\u5c07C++ \\u5df2\\u5ba3\\u544a\\u7684\\u8b8a\\u6578\\u505a \\u521d\\u59cb\\u503c\\u4ee3\\u5165\\u3002 \\u7bc4\\u4f8b01 #include int main(){ \\\/\\\/\\u521d\\u59cb\\u503c\\u4ee3\\u5165 int a {6}; int b {3}; int\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/hugohabor.com\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/hugohabor.com\\\/?p=1201#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/hugohabor.com\\\/?author=1#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/hugohabor.com\\\/?author=1#author\"},\"datePublished\":\"2023-02-18T18:40:34+00:00\",\"dateModified\":\"2023-03-02T14:13:26+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/hugohabor.com\\\/#website\",\"url\":\"https:\\\/\\\/hugohabor.com\\\/\",\"name\":\"Hugo Habor\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/hugohabor.com\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"C++ Precedence And Associativity - Hugo Habor","description":"\u7576\u4f60\u6709\u7b97\u6578\u7684\u7d93\u9a57\u6642\uff0c\u4f60\u6703\u77e5\u9053\u5728\u505a\u56db\u5247\u904b\u7b97\u6642\u6703\u6709\u5148\u4e58\u9664\u5f8c\u52a0\u6e1b\u7684\u898f\u5247 \u7a0b\u5f0f\u7576\u7136\u4e5f\u6709\uff0cC++ \u88e1\u9762\u4e5f\u6709\u76f8\u95dc\u7684\u5148\u5f8c\u9806\u5e8f\u8207\u95dc\u806f\u6027 C++ Precedence and associativity \u5148\u524d\u89c0\u5ff5 What is the purpose of {} in C++? {} can be used to initialise variables in C++11 in the same way that they are used to initialise arrays and structures in C. {} \u53ef\u7528\u65bc\u5c07C++ \u5df2\u5ba3\u544a\u7684\u8b8a\u6578\u505a \u521d\u59cb\u503c\u4ee3\u5165\u3002 \u7bc4\u4f8b01 #include int main(){ \/\/\u521d\u59cb\u503c\u4ee3\u5165 int a {6}; int b {3}; int","canonical_url":"https:\/\/hugohabor.com\/?p=1201","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BlogPosting","@id":"https:\/\/hugohabor.com\/?p=1201#blogposting","name":"C++ Precedence And Associativity - Hugo Habor","headline":"C++ Precedence And Associativity","author":{"@id":"https:\/\/hugohabor.com\/?author=1#author"},"publisher":{"@id":"https:\/\/hugohabor.com\/#organization"},"datePublished":"2023-02-18T18:40:34+00:00","dateModified":"2023-03-02T14:13:26+00:00","inLanguage":"en-US","mainEntityOfPage":{"@id":"https:\/\/hugohabor.com\/?p=1201#webpage"},"isPartOf":{"@id":"https:\/\/hugohabor.com\/?p=1201#webpage"},"articleSection":"CPP, CPP, Operator Precedence"},{"@type":"BreadcrumbList","@id":"https:\/\/hugohabor.com\/?p=1201#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/hugohabor.com\/#listItem","position":1,"name":"Home","item":"https:\/\/hugohabor.com\/","nextItem":{"@type":"ListItem","@id":"https:\/\/hugohabor.com\/?cat=60#listItem","name":"CPP"}},{"@type":"ListItem","@id":"https:\/\/hugohabor.com\/?cat=60#listItem","position":2,"name":"CPP","item":"https:\/\/hugohabor.com\/?cat=60","nextItem":{"@type":"ListItem","@id":"https:\/\/hugohabor.com\/?p=1201#listItem","name":"C++ Precedence And Associativity"},"previousItem":{"@type":"ListItem","@id":"https:\/\/hugohabor.com\/#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/hugohabor.com\/?p=1201#listItem","position":3,"name":"C++ Precedence And Associativity","previousItem":{"@type":"ListItem","@id":"https:\/\/hugohabor.com\/?cat=60#listItem","name":"CPP"}}]},{"@type":"Organization","@id":"https:\/\/hugohabor.com\/#organization","name":"Hugo Habor","url":"https:\/\/hugohabor.com\/"},{"@type":"Person","@id":"https:\/\/hugohabor.com\/?author=1#author","url":"https:\/\/hugohabor.com\/?author=1","name":"lioajimzen","image":{"@type":"ImageObject","@id":"https:\/\/hugohabor.com\/?p=1201#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/5e05b09ba406383ee0db1294db14a85fc4351ecd5ad2d7ab030e112459281aec?s=96&d=mm&r=g","width":96,"height":96,"caption":"lioajimzen"}},{"@type":"WebPage","@id":"https:\/\/hugohabor.com\/?p=1201#webpage","url":"https:\/\/hugohabor.com\/?p=1201","name":"C++ Precedence And Associativity - Hugo Habor","description":"\u7576\u4f60\u6709\u7b97\u6578\u7684\u7d93\u9a57\u6642\uff0c\u4f60\u6703\u77e5\u9053\u5728\u505a\u56db\u5247\u904b\u7b97\u6642\u6703\u6709\u5148\u4e58\u9664\u5f8c\u52a0\u6e1b\u7684\u898f\u5247 \u7a0b\u5f0f\u7576\u7136\u4e5f\u6709\uff0cC++ \u88e1\u9762\u4e5f\u6709\u76f8\u95dc\u7684\u5148\u5f8c\u9806\u5e8f\u8207\u95dc\u806f\u6027 C++ Precedence and associativity \u5148\u524d\u89c0\u5ff5 What is the purpose of {} in C++? {} can be used to initialise variables in C++11 in the same way that they are used to initialise arrays and structures in C. {} \u53ef\u7528\u65bc\u5c07C++ \u5df2\u5ba3\u544a\u7684\u8b8a\u6578\u505a \u521d\u59cb\u503c\u4ee3\u5165\u3002 \u7bc4\u4f8b01 #include int main(){ \/\/\u521d\u59cb\u503c\u4ee3\u5165 int a {6}; int b {3}; int","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/hugohabor.com\/#website"},"breadcrumb":{"@id":"https:\/\/hugohabor.com\/?p=1201#breadcrumblist"},"author":{"@id":"https:\/\/hugohabor.com\/?author=1#author"},"creator":{"@id":"https:\/\/hugohabor.com\/?author=1#author"},"datePublished":"2023-02-18T18:40:34+00:00","dateModified":"2023-03-02T14:13:26+00:00"},{"@type":"WebSite","@id":"https:\/\/hugohabor.com\/#website","url":"https:\/\/hugohabor.com\/","name":"Hugo Habor","inLanguage":"en-US","publisher":{"@id":"https:\/\/hugohabor.com\/#organization"}}]},"og:locale":"en_US","og:site_name":"Hugo Habor -","og:type":"article","og:title":"C++ Precedence And Associativity - Hugo Habor","og:description":"\u7576\u4f60\u6709\u7b97\u6578\u7684\u7d93\u9a57\u6642\uff0c\u4f60\u6703\u77e5\u9053\u5728\u505a\u56db\u5247\u904b\u7b97\u6642\u6703\u6709\u5148\u4e58\u9664\u5f8c\u52a0\u6e1b\u7684\u898f\u5247 \u7a0b\u5f0f\u7576\u7136\u4e5f\u6709\uff0cC++ \u88e1\u9762\u4e5f\u6709\u76f8\u95dc\u7684\u5148\u5f8c\u9806\u5e8f\u8207\u95dc\u806f\u6027 C++ Precedence and associativity \u5148\u524d\u89c0\u5ff5 What is the purpose of {} in C++? {} can be used to initialise variables in C++11 in the same way that they are used to initialise arrays and structures in C. {} \u53ef\u7528\u65bc\u5c07C++ \u5df2\u5ba3\u544a\u7684\u8b8a\u6578\u505a \u521d\u59cb\u503c\u4ee3\u5165\u3002 \u7bc4\u4f8b01 #include int main(){ \/\/\u521d\u59cb\u503c\u4ee3\u5165 int a {6}; int b {3}; int","og:url":"https:\/\/hugohabor.com\/?p=1201","og:image":"https:\/\/hugohabor.com\/wp-content\/uploads\/2023\/04\/274991094_1520511498332602_3929754424052866637_n.jpg","og:image:secure_url":"https:\/\/hugohabor.com\/wp-content\/uploads\/2023\/04\/274991094_1520511498332602_3929754424052866637_n.jpg","og:image:width":960,"og:image:height":960,"article:published_time":"2023-02-18T18:40:34+00:00","article:modified_time":"2023-03-02T14:13:26+00:00","twitter:card":"summary_large_image","twitter:title":"C++ Precedence And Associativity - Hugo Habor","twitter:description":"\u7576\u4f60\u6709\u7b97\u6578\u7684\u7d93\u9a57\u6642\uff0c\u4f60\u6703\u77e5\u9053\u5728\u505a\u56db\u5247\u904b\u7b97\u6642\u6703\u6709\u5148\u4e58\u9664\u5f8c\u52a0\u6e1b\u7684\u898f\u5247 \u7a0b\u5f0f\u7576\u7136\u4e5f\u6709\uff0cC++ \u88e1\u9762\u4e5f\u6709\u76f8\u95dc\u7684\u5148\u5f8c\u9806\u5e8f\u8207\u95dc\u806f\u6027 C++ Precedence and associativity \u5148\u524d\u89c0\u5ff5 What is the purpose of {} in C++? {} can be used to initialise variables in C++11 in the same way that they are used to initialise arrays and structures in C. {} \u53ef\u7528\u65bc\u5c07C++ \u5df2\u5ba3\u544a\u7684\u8b8a\u6578\u505a \u521d\u59cb\u503c\u4ee3\u5165\u3002 \u7bc4\u4f8b01 #include int main(){ \/\/\u521d\u59cb\u503c\u4ee3\u5165 int a {6}; int b {3}; int","twitter:image":"https:\/\/hugohabor.com\/wp-content\/uploads\/2023\/04\/274991094_1520511498332602_3929754424052866637_n.jpg"},"aioseo_meta_data":{"post_id":"1201","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2026-03-09 19:15:54","updated":"2026-03-09 19:15:54","seo_analyzer_scan_date":null,"focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/hugohabor.com\/\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/hugohabor.com\/?cat=60\" title=\"CPP\">CPP<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tC++ Precedence And Associativity\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/hugohabor.com\/"},{"label":"CPP","link":"https:\/\/hugohabor.com\/?cat=60"},{"label":"C++ Precedence And Associativity","link":"https:\/\/hugohabor.com\/?p=1201"}],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>C++ Precedence And Associativity - Hugo Habor<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/hugohabor.com\/?p=1201\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"C++ Precedence And Associativity - Hugo Habor\" \/>\n<meta property=\"og:description\" content=\"\u7576\u4f60\u6709\u7b97\u6578\u7684\u7d93\u9a57\u6642\uff0c\u4f60\u6703\u77e5\u9053\u5728\u505a\u56db\u5247\u904b\u7b97\u6642\u6703\u6709\u5148\u4e58\u9664\u5f8c\u52a0\u6e1b\u7684\u898f\u5247 \u7a0b\u5f0f\u7576\u7136\u4e5f\u6709\uff0cC++ \u88e1\u9762\u4e5f\u6709\u76f8\u95dc\u7684\u5148\u5f8c\u9806\u5e8f\u8207\u95dc\u806f\u6027 C++ Precedence and associativity \u5148\u524d\u89c0\u5ff5 What is the purpose of {} in C++? {} can be used to&nbsp;initialise variables&nbsp;in C++11 in the same way that they are used to initialise arrays and structures in C. {} \u53ef\u7528\u65bc\u5c07C++ \u5df2\u5ba3\u544a\u7684\u8b8a\u6578\u505a \u521d\u59cb\u503c\u4ee3\u5165\u3002 \u7bc4\u4f8b01 \u7bc4\u4f8b02\" \/>\n<meta property=\"og:url\" content=\"https:\/\/hugohabor.com\/?p=1201\" \/>\n<meta property=\"og:site_name\" content=\"Hugo Habor\" \/>\n<meta property=\"article:published_time\" content=\"2023-02-18T18:40:34+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-03-02T14:13:26+00:00\" \/>\n<meta name=\"author\" content=\"lioajimzen\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"lioajimzen\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/hugohabor.com\\\/?p=1201#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/hugohabor.com\\\/?p=1201\"},\"author\":{\"name\":\"lioajimzen\",\"@id\":\"http:\\\/\\\/box2025.temp.domains\\\/~hugohabo\\\/#\\\/schema\\\/person\\\/d87a724a8ca78e641cda8de55cf2114b\"},\"headline\":\"C++ Precedence And Associativity\",\"datePublished\":\"2023-02-18T18:40:34+00:00\",\"dateModified\":\"2023-03-02T14:13:26+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/hugohabor.com\\\/?p=1201\"},\"wordCount\":42,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\\\/\\\/box2025.temp.domains\\\/~hugohabo\\\/#organization\"},\"keywords\":[\"CPP\",\"Operator Precedence\"],\"articleSection\":[\"CPP\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/hugohabor.com\\\/?p=1201#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/hugohabor.com\\\/?p=1201\",\"url\":\"https:\\\/\\\/hugohabor.com\\\/?p=1201\",\"name\":\"C++ Precedence And Associativity - Hugo Habor\",\"isPartOf\":{\"@id\":\"http:\\\/\\\/box2025.temp.domains\\\/~hugohabo\\\/#website\"},\"datePublished\":\"2023-02-18T18:40:34+00:00\",\"dateModified\":\"2023-03-02T14:13:26+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/hugohabor.com\\\/?p=1201#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/hugohabor.com\\\/?p=1201\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/hugohabor.com\\\/?p=1201#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/hugohabor.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"C++ Precedence And Associativity\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\\\/\\\/box2025.temp.domains\\\/~hugohabo\\\/#website\",\"url\":\"http:\\\/\\\/box2025.temp.domains\\\/~hugohabo\\\/\",\"name\":\"Hugo Habor\",\"description\":\"\",\"publisher\":{\"@id\":\"http:\\\/\\\/box2025.temp.domains\\\/~hugohabo\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\\\/\\\/box2025.temp.domains\\\/~hugohabo\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"http:\\\/\\\/box2025.temp.domains\\\/~hugohabo\\\/#organization\",\"name\":\"Hugo Habor\",\"url\":\"http:\\\/\\\/box2025.temp.domains\\\/~hugohabo\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\\\/\\\/box2025.temp.domains\\\/~hugohabo\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/i0.wp.com\\\/hugohabor.com\\\/wp-content\\\/uploads\\\/2023\\\/04\\\/274991094_1520511498332602_3929754424052866637_n.jpg?fit=960%2C960&ssl=1\",\"contentUrl\":\"https:\\\/\\\/i0.wp.com\\\/hugohabor.com\\\/wp-content\\\/uploads\\\/2023\\\/04\\\/274991094_1520511498332602_3929754424052866637_n.jpg?fit=960%2C960&ssl=1\",\"width\":960,\"height\":960,\"caption\":\"Hugo Habor\"},\"image\":{\"@id\":\"http:\\\/\\\/box2025.temp.domains\\\/~hugohabo\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"http:\\\/\\\/box2025.temp.domains\\\/~hugohabo\\\/#\\\/schema\\\/person\\\/d87a724a8ca78e641cda8de55cf2114b\",\"name\":\"lioajimzen\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5e05b09ba406383ee0db1294db14a85fc4351ecd5ad2d7ab030e112459281aec?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5e05b09ba406383ee0db1294db14a85fc4351ecd5ad2d7ab030e112459281aec?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5e05b09ba406383ee0db1294db14a85fc4351ecd5ad2d7ab030e112459281aec?s=96&d=mm&r=g\",\"caption\":\"lioajimzen\"},\"url\":\"https:\\\/\\\/hugohabor.com\\\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"C++ Precedence And Associativity - Hugo Habor","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/hugohabor.com\/?p=1201","og_locale":"en_US","og_type":"article","og_title":"C++ Precedence And Associativity - Hugo Habor","og_description":"\u7576\u4f60\u6709\u7b97\u6578\u7684\u7d93\u9a57\u6642\uff0c\u4f60\u6703\u77e5\u9053\u5728\u505a\u56db\u5247\u904b\u7b97\u6642\u6703\u6709\u5148\u4e58\u9664\u5f8c\u52a0\u6e1b\u7684\u898f\u5247 \u7a0b\u5f0f\u7576\u7136\u4e5f\u6709\uff0cC++ \u88e1\u9762\u4e5f\u6709\u76f8\u95dc\u7684\u5148\u5f8c\u9806\u5e8f\u8207\u95dc\u806f\u6027 C++ Precedence and associativity \u5148\u524d\u89c0\u5ff5 What is the purpose of {} in C++? {} can be used to&nbsp;initialise variables&nbsp;in C++11 in the same way that they are used to initialise arrays and structures in C. {} \u53ef\u7528\u65bc\u5c07C++ \u5df2\u5ba3\u544a\u7684\u8b8a\u6578\u505a \u521d\u59cb\u503c\u4ee3\u5165\u3002 \u7bc4\u4f8b01 \u7bc4\u4f8b02","og_url":"https:\/\/hugohabor.com\/?p=1201","og_site_name":"Hugo Habor","article_published_time":"2023-02-18T18:40:34+00:00","article_modified_time":"2023-03-02T14:13:26+00:00","author":"lioajimzen","twitter_card":"summary_large_image","twitter_misc":{"Written by":"lioajimzen","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/hugohabor.com\/?p=1201#article","isPartOf":{"@id":"https:\/\/hugohabor.com\/?p=1201"},"author":{"name":"lioajimzen","@id":"http:\/\/box2025.temp.domains\/~hugohabo\/#\/schema\/person\/d87a724a8ca78e641cda8de55cf2114b"},"headline":"C++ Precedence And Associativity","datePublished":"2023-02-18T18:40:34+00:00","dateModified":"2023-03-02T14:13:26+00:00","mainEntityOfPage":{"@id":"https:\/\/hugohabor.com\/?p=1201"},"wordCount":42,"commentCount":0,"publisher":{"@id":"http:\/\/box2025.temp.domains\/~hugohabo\/#organization"},"keywords":["CPP","Operator Precedence"],"articleSection":["CPP"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/hugohabor.com\/?p=1201#respond"]}]},{"@type":"WebPage","@id":"https:\/\/hugohabor.com\/?p=1201","url":"https:\/\/hugohabor.com\/?p=1201","name":"C++ Precedence And Associativity - Hugo Habor","isPartOf":{"@id":"http:\/\/box2025.temp.domains\/~hugohabo\/#website"},"datePublished":"2023-02-18T18:40:34+00:00","dateModified":"2023-03-02T14:13:26+00:00","breadcrumb":{"@id":"https:\/\/hugohabor.com\/?p=1201#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/hugohabor.com\/?p=1201"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/hugohabor.com\/?p=1201#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/hugohabor.com\/"},{"@type":"ListItem","position":2,"name":"C++ Precedence And Associativity"}]},{"@type":"WebSite","@id":"http:\/\/box2025.temp.domains\/~hugohabo\/#website","url":"http:\/\/box2025.temp.domains\/~hugohabo\/","name":"Hugo Habor","description":"","publisher":{"@id":"http:\/\/box2025.temp.domains\/~hugohabo\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/box2025.temp.domains\/~hugohabo\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"http:\/\/box2025.temp.domains\/~hugohabo\/#organization","name":"Hugo Habor","url":"http:\/\/box2025.temp.domains\/~hugohabo\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/box2025.temp.domains\/~hugohabo\/#\/schema\/logo\/image\/","url":"https:\/\/i0.wp.com\/hugohabor.com\/wp-content\/uploads\/2023\/04\/274991094_1520511498332602_3929754424052866637_n.jpg?fit=960%2C960&ssl=1","contentUrl":"https:\/\/i0.wp.com\/hugohabor.com\/wp-content\/uploads\/2023\/04\/274991094_1520511498332602_3929754424052866637_n.jpg?fit=960%2C960&ssl=1","width":960,"height":960,"caption":"Hugo Habor"},"image":{"@id":"http:\/\/box2025.temp.domains\/~hugohabo\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"http:\/\/box2025.temp.domains\/~hugohabo\/#\/schema\/person\/d87a724a8ca78e641cda8de55cf2114b","name":"lioajimzen","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/5e05b09ba406383ee0db1294db14a85fc4351ecd5ad2d7ab030e112459281aec?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/5e05b09ba406383ee0db1294db14a85fc4351ecd5ad2d7ab030e112459281aec?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5e05b09ba406383ee0db1294db14a85fc4351ecd5ad2d7ab030e112459281aec?s=96&d=mm&r=g","caption":"lioajimzen"},"url":"https:\/\/hugohabor.com\/?author=1"}]}},"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/hugohabor.com\/index.php?rest_route=\/wp\/v2\/posts\/1201","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hugohabor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hugohabor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hugohabor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hugohabor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1201"}],"version-history":[{"count":6,"href":"https:\/\/hugohabor.com\/index.php?rest_route=\/wp\/v2\/posts\/1201\/revisions"}],"predecessor-version":[{"id":1210,"href":"https:\/\/hugohabor.com\/index.php?rest_route=\/wp\/v2\/posts\/1201\/revisions\/1210"}],"wp:attachment":[{"href":"https:\/\/hugohabor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1201"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hugohabor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1201"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hugohabor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1201"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}