string字符串比较 c++
时间: 2023-08-19 21:04:43 浏览: 160
在给定的代码中,字符串的比较是通过使用关系操作符进行的。如果两个字符串s1和s2相等,它们的每个字符都相等,长度也相等。如果s1小于s2,那么s1的第一个不相等的字符的ASCLL码值小于s2的对应字符的ASCLL码值。如果s1大于s2,那么s1的第一个不相等的字符的ASCLL码值大于s2的对应字符的ASCLL码值。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* *3* [c++ string字符串详解](https://blog.csdn.net/m0_62870588/article/details/123716198)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT0_1"}}] [.reference_item style="max-width: 100%"]
[ .reference_list ]
阅读全文