mirror of
https://github.com/jaywcjlove/reference.git
synced 2025-06-24 16:01:30 +08:00
Compare commits
16 Commits
0137615b29
...
f858489365
Author | SHA1 | Date | |
---|---|---|---|
f858489365 | |||
579d1de673 | |||
daaa4c5f09 | |||
b414893b15 | |||
072ddcca73 | |||
5e773f0696 | |||
3bcb61d409 | |||
ad9aaf759e | |||
211809a177 | |||
e7b8958368 | |||
d7df8bc6fe | |||
ba05c9d952 | |||
d02dc80480 | |||
eb1157523d | |||
6c8217202a | |||
1bd8c8372a |
@ -355,7 +355,7 @@ jobs:
|
||||
<a href="https://github.com/xia0ne" title="YuRuiH"><img src="https://avatars.githubusercontent.com/u/32591223?v=4" width="42;" alt="YuRuiH"/></a>
|
||||
<a href="https://github.com/Willxup" title="Willxup"><img src="https://avatars.githubusercontent.com/u/51990395?v=4" width="42;" alt="Willxup"/></a>
|
||||
<a href="https://github.com/LiuYuan-SHU" title="Yuan Liu"><img src="https://avatars.githubusercontent.com/u/96400967?v=4" width="42;" alt="Yuan Liu"/></a>
|
||||
<a href="https://github.com/AmosHuKe" title="Amos"><img src="https://avatars.githubusercontent.com/u/32262985?v=4" width="42;" alt="Amos"/></a>
|
||||
<a href="https://github.com/infanx" title="infanx"><img src="https://avatars.githubusercontent.com/u/65985757?v=4" width="42;" alt="infanx"/></a>
|
||||
<a href="https://github.com/1834423612" title="kjch"><img src="https://avatars.githubusercontent.com/u/49981661?v=4" width="42;" alt="kjch"/></a>
|
||||
<a href="https://github.com/mancuoj" title="mancuoj"><img src="https://avatars.githubusercontent.com/u/45707684?v=4" width="42;" alt="mancuoj"/></a>
|
||||
<a href="https://github.com/pangxiaoli" title="pangxiaoli"><img src="https://avatars.githubusercontent.com/u/54620953?v=4" width="42;" alt="pangxiaoli"/></a>
|
||||
@ -367,20 +367,20 @@ jobs:
|
||||
<a href="https://github.com/wsypower" title="魏"><img src="https://avatars.githubusercontent.com/u/31298317?v=4" width="42;" alt="魏"/></a>
|
||||
<a href="https://github.com/buyfakett" title="buyfakett"><img src="https://avatars.githubusercontent.com/u/46560426?v=4" width="42;" alt="buyfakett"/></a>
|
||||
<a href="https://github.com/wangdaodao" title="王叨叨"><img src="https://avatars.githubusercontent.com/u/2317442?v=4" width="42;" alt="王叨叨"/></a>
|
||||
<a href="https://github.com/AmosHuKe" title="Amos"><img src="https://avatars.githubusercontent.com/u/32262985?v=4" width="42;" alt="Amos"/></a>
|
||||
<a href="https://github.com/qjksxy" title="Apin"><img src="https://avatars.githubusercontent.com/u/81305669?v=4" width="42;" alt="Apin"/></a>
|
||||
<a href="https://github.com/dadatom" title="Da Da"><img src="https://avatars.githubusercontent.com/u/33886943?v=4" width="42;" alt="Da Da"/></a>
|
||||
<a href="https://github.com/ljq" title="Jack Liu"><img src="https://avatars.githubusercontent.com/u/7278286?v=4" width="42;" alt="Jack Liu"/></a>
|
||||
<a href="https://github.com/jasnzhuang" title="Jason Zhuang"><img src="https://avatars.githubusercontent.com/u/16612921?v=4" width="42;" alt="Jason Zhuang"/></a>
|
||||
<a href="https://github.com/Jovins" title="Jovins"><img src="https://avatars.githubusercontent.com/u/17738992?v=4" width="42;" alt="Jovins"/></a>
|
||||
<a href="https://github.com/Kisa-Dong" title="Kisa-Dong"><img src="https://avatars.githubusercontent.com/u/84782008?v=4" width="42;" alt="Kisa-Dong"/></a>
|
||||
<a href="https://github.com/infanx" title="infanx"><img src="https://avatars.githubusercontent.com/u/65985757?v=4" width="42;" alt="infanx"/></a>
|
||||
<a href="https://github.com/greyhao" title="greyhao"><img src="https://avatars.githubusercontent.com/u/107107440?v=4" width="42;" alt="greyhao"/></a>
|
||||
<a href="https://github.com/findnr" title="findnr"><img src="https://avatars.githubusercontent.com/u/3909023?v=4" width="42;" alt="findnr"/></a>
|
||||
<a href="https://github.com/izven" title="Zhang"><img src="https://avatars.githubusercontent.com/u/2149051?v=4" width="42;" alt="Zhang"/></a>
|
||||
<a href="https://github.com/XYZscratcher" title="XYZ"><img src="https://avatars.githubusercontent.com/u/108533817?v=4" width="42;" alt="XYZ"/></a>
|
||||
<a href="https://github.com/ThanatosXingYu" title="Thanatos"><img src="https://avatars.githubusercontent.com/u/53430376?v=4" width="42;" alt="Thanatos"/></a>
|
||||
<a href="https://github.com/SuperDiscovery" title="SuperDiscovery"><img src="https://avatars.githubusercontent.com/u/49646863?v=4" width="42;" alt="SuperDiscovery"/></a>
|
||||
<a href="https://github.com/long-910" title="Small Long"><img src="https://avatars.githubusercontent.com/u/7323488?v=4" width="42;" alt="Small Long"/></a>
|
||||
<a href="https://github.com/hua03" title="hua03"><img src="https://avatars.githubusercontent.com/u/19561959?v=4" width="42;" alt="hua03"/></a>
|
||||
<a href="https://github.com/yanxuplay" title="hupilan"><img src="https://avatars.githubusercontent.com/u/69749541?v=4" width="42;" alt="hupilan"/></a>
|
||||
<a href="https://github.com/hweining" title="hweining"><img src="https://avatars.githubusercontent.com/u/8973985?v=4" width="42;" alt="hweining"/></a>
|
||||
<a href="https://github.com/auroraslot" title="irony"><img src="https://avatars.githubusercontent.com/u/48817882?v=4" width="42;" alt="irony"/></a>
|
||||
@ -394,6 +394,8 @@ jobs:
|
||||
<a href="https://github.com/larry-xue" title="yujian(larry) xue"><img src="https://avatars.githubusercontent.com/u/48818060?v=4" width="42;" alt="yujian(larry) xue"/></a>
|
||||
<a href="https://github.com/leauny" title="leauny"><img src="https://avatars.githubusercontent.com/u/42369176?v=4" width="42;" alt="leauny"/></a>
|
||||
<a href="https://github.com/liliangrong777" title="liliangrong777"><img src="https://avatars.githubusercontent.com/u/58727146?v=4" width="42;" alt="liliangrong777"/></a>
|
||||
<a href="https://github.com/Zeng-qh" title="都一样"><img src="https://avatars.githubusercontent.com/u/40046415?v=4" width="42;" alt="都一样"/></a>
|
||||
<a href="https://github.com/hua03" title="hua03"><img src="https://avatars.githubusercontent.com/u/19561959?v=4" width="42;" alt="hua03"/></a>
|
||||
<a href="https://github.com/gzttcydxx" title="gzttcydxx"><img src="https://avatars.githubusercontent.com/u/50025185?v=4" width="42;" alt="gzttcydxx"/></a>
|
||||
<a href="https://github.com/sunny0826" title="Xudong Guo"><img src="https://avatars.githubusercontent.com/u/24563928?v=4" width="42;" alt="Xudong Guo"/></a>
|
||||
<a href="https://github.com/nodjoy" title="gowshwah"><img src="https://avatars.githubusercontent.com/u/145280043?v=4" width="42;" alt="gowshwah"/></a>
|
||||
@ -406,8 +408,7 @@ jobs:
|
||||
<a href="https://github.com/lijc210" title="cizai"><img src="https://avatars.githubusercontent.com/u/10651081?v=4" width="42;" alt="cizai"/></a>
|
||||
<a href="https://github.com/chyok" title="chyok"><img src="https://avatars.githubusercontent.com/u/32629225?v=4" width="42;" alt="chyok"/></a>
|
||||
<a href="https://github.com/zlfyuan" title="bgbgPang"><img src="https://avatars.githubusercontent.com/u/19658018?v=4" width="42;" alt="bgbgPang"/></a>
|
||||
<a href="https://github.com/Lmmmmmm-bb" title="_lmmmmmm"><img src="https://avatars.githubusercontent.com/u/54026110?v=4" width="42;" alt="_lmmmmmm"/></a>
|
||||
<a href="https://github.com/Zeng-qh" title="都一样"><img src="https://avatars.githubusercontent.com/u/40046415?v=4" width="42;" alt="都一样"/></a>
|
||||
<a href="https://github.com/mariuszmichalowski" title="Mariusz Michalowski"><img src="https://avatars.githubusercontent.com/u/92091891?v=4" width="42;" alt="Mariusz Michalowski"/></a>
|
||||
<a href="https://github.com/binscor" title="Zheng Nai Bin"><img src="https://avatars.githubusercontent.com/u/37325821?v=4" width="42;" alt="Zheng Nai Bin"/></a>
|
||||
<a href="https://github.com/qwxingzhe" title="行者"><img src="https://avatars.githubusercontent.com/u/7071651?v=4" width="42;" alt="行者"/></a>
|
||||
<a href="https://github.com/lisheng741" title="芦荟柚子茶"><img src="https://avatars.githubusercontent.com/u/53617305?v=4" width="42;" alt="芦荟柚子茶"/></a>
|
||||
@ -429,13 +430,13 @@ jobs:
|
||||
<a href="https://github.com/swift-fs" title="swift-fs"><img src="https://avatars.githubusercontent.com/u/77133741?v=4" width="42;" alt="swift-fs"/></a>
|
||||
<a href="https://github.com/suyangzuo" title="suyangzuo"><img src="https://avatars.githubusercontent.com/u/50766353?v=4" width="42;" alt="suyangzuo"/></a>
|
||||
<a href="https://github.com/Mowmowj" title="nexo"><img src="https://avatars.githubusercontent.com/u/24759562?v=4" width="42;" alt="nexo"/></a>
|
||||
<a href="https://github.com/ri-fumo" title="ri-fumo"><img src="https://avatars.githubusercontent.com/u/190000479?v=4" width="42;" alt="ri-fumo"/></a>
|
||||
<a href="https://github.com/phygerr" title="phygerr"><img src="https://avatars.githubusercontent.com/u/42068889?v=4" width="42;" alt="phygerr"/></a>
|
||||
<a href="https://github.com/openapphub" title="openapphub"><img src="https://avatars.githubusercontent.com/u/175949671?v=4" width="42;" alt="openapphub"/></a>
|
||||
<a href="https://github.com/onewesong" title="onewesong"><img src="https://avatars.githubusercontent.com/u/17920822?v=4" width="42;" alt="onewesong"/></a>
|
||||
<a href="https://github.com/miclon-dev" title="miclon-dev"><img src="https://avatars.githubusercontent.com/u/111753685?v=4" width="42;" alt="miclon-dev"/></a>
|
||||
<a href="https://github.com/lykjjj" title="lykjjj"><img src="https://avatars.githubusercontent.com/u/58510058?v=4" width="42;" alt="lykjjj"/></a>
|
||||
<a href="https://github.com/lozhu20" title="lozhu"><img src="https://avatars.githubusercontent.com/u/44923922?v=4" width="42;" alt="lozhu"/></a>
|
||||
<a href="https://github.com/y52y" title="Zyj"><img src="https://avatars.githubusercontent.com/u/51304324?v=4" width="42;" alt="Zyj"/></a>
|
||||
<a href="https://github.com/isecret" title="Mao Wang"><img src="https://avatars.githubusercontent.com/u/15724152?v=4" width="42;" alt="Mao Wang"/></a>
|
||||
<a href="https://github.com/lvelvee" title="Lve Lvee"><img src="https://avatars.githubusercontent.com/u/25785753?v=4" width="42;" alt="Lve Lvee"/></a>
|
||||
<a href="https://github.com/likeadmin-likeshop" title="likeadmin通过管理后台-likeshop全开源商城"><img src="https://avatars.githubusercontent.com/u/77180968?v=4" width="42;" alt="likeadmin通过管理后台-likeshop全开源商城"/></a>
|
||||
@ -464,6 +465,8 @@ jobs:
|
||||
<a href="https://github.com/dousha0w0" title="dousha0w0"><img src="https://avatars.githubusercontent.com/u/52566311?v=4" width="42;" alt="dousha0w0"/></a>
|
||||
<a href="https://github.com/JinchuanL" title="ANDY"><img src="https://avatars.githubusercontent.com/u/68026794?v=4" width="42;" alt="ANDY"/></a>
|
||||
<a href="https://github.com/13812700839" title="花殇"><img src="https://avatars.githubusercontent.com/u/58072506?v=4" width="42;" alt="花殇"/></a>
|
||||
<a href="https://github.com/Lmmmmmm-bb" title="_lmmmmmm"><img src="https://avatars.githubusercontent.com/u/54026110?v=4" width="42;" alt="_lmmmmmm"/></a>
|
||||
<a href="https://github.com/y52y" title="Zyj"><img src="https://avatars.githubusercontent.com/u/51304324?v=4" width="42;" alt="Zyj"/></a>
|
||||
<a href="https://github.com/Leaderzhangyi" title="ZinkCas"><img src="https://avatars.githubusercontent.com/u/46915666?v=4" width="42;" alt="ZinkCas"/></a>
|
||||
<a href="https://github.com/zhu0629" title="zhucong"><img src="https://avatars.githubusercontent.com/u/13188450?v=4" width="42;" alt="zhucong"/></a>
|
||||
<a href="https://github.com/yikuaibro" title="yikuaibro"><img src="https://avatars.githubusercontent.com/u/44493045?v=4" width="42;" alt="yikuaibro"/></a>
|
||||
@ -490,8 +493,7 @@ jobs:
|
||||
<a href="https://github.com/mo3et" title="Monet Lee"><img src="https://avatars.githubusercontent.com/u/34803812?v=4" width="42;" alt="Monet Lee"/></a>
|
||||
<a href="https://github.com/Moeyuuko" title="Moeyuuko"><img src="https://avatars.githubusercontent.com/u/14266681?v=4" width="42;" alt="Moeyuuko"/></a>
|
||||
<a href="https://github.com/malcolmyu" title="Minghao Yu"><img src="https://avatars.githubusercontent.com/u/3203962?v=4" width="42;" alt="Minghao Yu"/></a>
|
||||
<a href="https://github.com/Mieriki" title="Mieriki"><img src="https://avatars.githubusercontent.com/u/142009318?v=4" width="42;" alt="Mieriki"/></a>
|
||||
<a href="https://github.com/mariuszmichalowski" title="Mariusz Michalowski"><img src="https://avatars.githubusercontent.com/u/92091891?v=4" width="42;" alt="Mariusz Michalowski"/></a><!--GAMFC-END-->
|
||||
<a href="https://github.com/Mieriki" title="Mieriki"><img src="https://avatars.githubusercontent.com/u/142009318?v=4" width="42;" alt="Mieriki"/></a><!--GAMFC-END-->
|
||||
|
||||
上图贡献者列表,由 [contributors](https://github.com/jaywcjlove/github-action-contributors) 自动生成贡献者图片。
|
||||
|
||||
|
46
README.md
46
README.md
@ -2,7 +2,7 @@ Quick Reference
|
||||
===
|
||||
|
||||
<!--rehype:ignore:start-->
|
||||
[](https://jaywcjlove.github.io/#/sponsor)
|
||||
[](https://jaywcjlove.github.io/#/sponsor)
|
||||
[](https://github.com/jaywcjlove/reference/actions/workflows/ci.yml)
|
||||
[](https://hub.docker.com/r/wcjiang/reference)
|
||||
[](https://hub.docker.com/r/wcjiang/reference)
|
||||
@ -318,7 +318,7 @@ Quick Reference
|
||||
<a href="https://github.com/xia0ne" title="YuRuiH"><img src="https://avatars.githubusercontent.com/u/32591223?v=4" width="42;" alt="YuRuiH"/></a>
|
||||
<a href="https://github.com/Willxup" title="Willxup"><img src="https://avatars.githubusercontent.com/u/51990395?v=4" width="42;" alt="Willxup"/></a>
|
||||
<a href="https://github.com/LiuYuan-SHU" title="Yuan Liu"><img src="https://avatars.githubusercontent.com/u/96400967?v=4" width="42;" alt="Yuan Liu"/></a>
|
||||
<a href="https://github.com/AmosHuKe" title="Amos"><img src="https://avatars.githubusercontent.com/u/32262985?v=4" width="42;" alt="Amos"/></a>
|
||||
<a href="https://github.com/infanx" title="infanx"><img src="https://avatars.githubusercontent.com/u/65985757?v=4" width="42;" alt="infanx"/></a>
|
||||
<a href="https://github.com/1834423612" title="kjch"><img src="https://avatars.githubusercontent.com/u/49981661?v=4" width="42;" alt="kjch"/></a>
|
||||
<a href="https://github.com/mancuoj" title="mancuoj"><img src="https://avatars.githubusercontent.com/u/45707684?v=4" width="42;" alt="mancuoj"/></a>
|
||||
<a href="https://github.com/pangxiaoli" title="pangxiaoli"><img src="https://avatars.githubusercontent.com/u/54620953?v=4" width="42;" alt="pangxiaoli"/></a>
|
||||
@ -330,20 +330,20 @@ Quick Reference
|
||||
<a href="https://github.com/wsypower" title="魏"><img src="https://avatars.githubusercontent.com/u/31298317?v=4" width="42;" alt="魏"/></a>
|
||||
<a href="https://github.com/buyfakett" title="buyfakett"><img src="https://avatars.githubusercontent.com/u/46560426?v=4" width="42;" alt="buyfakett"/></a>
|
||||
<a href="https://github.com/wangdaodao" title="王叨叨"><img src="https://avatars.githubusercontent.com/u/2317442?v=4" width="42;" alt="王叨叨"/></a>
|
||||
<a href="https://github.com/AmosHuKe" title="Amos"><img src="https://avatars.githubusercontent.com/u/32262985?v=4" width="42;" alt="Amos"/></a>
|
||||
<a href="https://github.com/qjksxy" title="Apin"><img src="https://avatars.githubusercontent.com/u/81305669?v=4" width="42;" alt="Apin"/></a>
|
||||
<a href="https://github.com/dadatom" title="Da Da"><img src="https://avatars.githubusercontent.com/u/33886943?v=4" width="42;" alt="Da Da"/></a>
|
||||
<a href="https://github.com/ljq" title="Jack Liu"><img src="https://avatars.githubusercontent.com/u/7278286?v=4" width="42;" alt="Jack Liu"/></a>
|
||||
<a href="https://github.com/jasnzhuang" title="Jason Zhuang"><img src="https://avatars.githubusercontent.com/u/16612921?v=4" width="42;" alt="Jason Zhuang"/></a>
|
||||
<a href="https://github.com/Jovins" title="Jovins"><img src="https://avatars.githubusercontent.com/u/17738992?v=4" width="42;" alt="Jovins"/></a>
|
||||
<a href="https://github.com/Kisa-Dong" title="Kisa-Dong"><img src="https://avatars.githubusercontent.com/u/84782008?v=4" width="42;" alt="Kisa-Dong"/></a>
|
||||
<a href="https://github.com/infanx" title="infanx"><img src="https://avatars.githubusercontent.com/u/65985757?v=4" width="42;" alt="infanx"/></a>
|
||||
<a href="https://github.com/greyhao" title="greyhao"><img src="https://avatars.githubusercontent.com/u/107107440?v=4" width="42;" alt="greyhao"/></a>
|
||||
<a href="https://github.com/findnr" title="findnr"><img src="https://avatars.githubusercontent.com/u/3909023?v=4" width="42;" alt="findnr"/></a>
|
||||
<a href="https://github.com/izven" title="Zhang"><img src="https://avatars.githubusercontent.com/u/2149051?v=4" width="42;" alt="Zhang"/></a>
|
||||
<a href="https://github.com/XYZscratcher" title="XYZ"><img src="https://avatars.githubusercontent.com/u/108533817?v=4" width="42;" alt="XYZ"/></a>
|
||||
<a href="https://github.com/ThanatosXingYu" title="Thanatos"><img src="https://avatars.githubusercontent.com/u/53430376?v=4" width="42;" alt="Thanatos"/></a>
|
||||
<a href="https://github.com/SuperDiscovery" title="SuperDiscovery"><img src="https://avatars.githubusercontent.com/u/49646863?v=4" width="42;" alt="SuperDiscovery"/></a>
|
||||
<a href="https://github.com/long-910" title="Small Long"><img src="https://avatars.githubusercontent.com/u/7323488?v=4" width="42;" alt="Small Long"/></a>
|
||||
<a href="https://github.com/hua03" title="hua03"><img src="https://avatars.githubusercontent.com/u/19561959?v=4" width="42;" alt="hua03"/></a>
|
||||
<a href="https://github.com/yanxuplay" title="hupilan"><img src="https://avatars.githubusercontent.com/u/69749541?v=4" width="42;" alt="hupilan"/></a>
|
||||
<a href="https://github.com/hweining" title="hweining"><img src="https://avatars.githubusercontent.com/u/8973985?v=4" width="42;" alt="hweining"/></a>
|
||||
<a href="https://github.com/auroraslot" title="irony"><img src="https://avatars.githubusercontent.com/u/48817882?v=4" width="42;" alt="irony"/></a>
|
||||
@ -357,6 +357,8 @@ Quick Reference
|
||||
<a href="https://github.com/larry-xue" title="yujian(larry) xue"><img src="https://avatars.githubusercontent.com/u/48818060?v=4" width="42;" alt="yujian(larry) xue"/></a>
|
||||
<a href="https://github.com/leauny" title="leauny"><img src="https://avatars.githubusercontent.com/u/42369176?v=4" width="42;" alt="leauny"/></a>
|
||||
<a href="https://github.com/liliangrong777" title="liliangrong777"><img src="https://avatars.githubusercontent.com/u/58727146?v=4" width="42;" alt="liliangrong777"/></a>
|
||||
<a href="https://github.com/Zeng-qh" title="都一样"><img src="https://avatars.githubusercontent.com/u/40046415?v=4" width="42;" alt="都一样"/></a>
|
||||
<a href="https://github.com/hua03" title="hua03"><img src="https://avatars.githubusercontent.com/u/19561959?v=4" width="42;" alt="hua03"/></a>
|
||||
<a href="https://github.com/gzttcydxx" title="gzttcydxx"><img src="https://avatars.githubusercontent.com/u/50025185?v=4" width="42;" alt="gzttcydxx"/></a>
|
||||
<a href="https://github.com/sunny0826" title="Xudong Guo"><img src="https://avatars.githubusercontent.com/u/24563928?v=4" width="42;" alt="Xudong Guo"/></a>
|
||||
<a href="https://github.com/nodjoy" title="gowshwah"><img src="https://avatars.githubusercontent.com/u/145280043?v=4" width="42;" alt="gowshwah"/></a>
|
||||
@ -369,8 +371,7 @@ Quick Reference
|
||||
<a href="https://github.com/lijc210" title="cizai"><img src="https://avatars.githubusercontent.com/u/10651081?v=4" width="42;" alt="cizai"/></a>
|
||||
<a href="https://github.com/chyok" title="chyok"><img src="https://avatars.githubusercontent.com/u/32629225?v=4" width="42;" alt="chyok"/></a>
|
||||
<a href="https://github.com/zlfyuan" title="bgbgPang"><img src="https://avatars.githubusercontent.com/u/19658018?v=4" width="42;" alt="bgbgPang"/></a>
|
||||
<a href="https://github.com/Lmmmmmm-bb" title="_lmmmmmm"><img src="https://avatars.githubusercontent.com/u/54026110?v=4" width="42;" alt="_lmmmmmm"/></a>
|
||||
<a href="https://github.com/Zeng-qh" title="都一样"><img src="https://avatars.githubusercontent.com/u/40046415?v=4" width="42;" alt="都一样"/></a>
|
||||
<a href="https://github.com/mariuszmichalowski" title="Mariusz Michalowski"><img src="https://avatars.githubusercontent.com/u/92091891?v=4" width="42;" alt="Mariusz Michalowski"/></a>
|
||||
<a href="https://github.com/binscor" title="Zheng Nai Bin"><img src="https://avatars.githubusercontent.com/u/37325821?v=4" width="42;" alt="Zheng Nai Bin"/></a>
|
||||
<a href="https://github.com/qwxingzhe" title="行者"><img src="https://avatars.githubusercontent.com/u/7071651?v=4" width="42;" alt="行者"/></a>
|
||||
<a href="https://github.com/lisheng741" title="芦荟柚子茶"><img src="https://avatars.githubusercontent.com/u/53617305?v=4" width="42;" alt="芦荟柚子茶"/></a>
|
||||
@ -392,13 +393,13 @@ Quick Reference
|
||||
<a href="https://github.com/swift-fs" title="swift-fs"><img src="https://avatars.githubusercontent.com/u/77133741?v=4" width="42;" alt="swift-fs"/></a>
|
||||
<a href="https://github.com/suyangzuo" title="suyangzuo"><img src="https://avatars.githubusercontent.com/u/50766353?v=4" width="42;" alt="suyangzuo"/></a>
|
||||
<a href="https://github.com/Mowmowj" title="nexo"><img src="https://avatars.githubusercontent.com/u/24759562?v=4" width="42;" alt="nexo"/></a>
|
||||
<a href="https://github.com/ri-fumo" title="ri-fumo"><img src="https://avatars.githubusercontent.com/u/190000479?v=4" width="42;" alt="ri-fumo"/></a>
|
||||
<a href="https://github.com/phygerr" title="phygerr"><img src="https://avatars.githubusercontent.com/u/42068889?v=4" width="42;" alt="phygerr"/></a>
|
||||
<a href="https://github.com/openapphub" title="openapphub"><img src="https://avatars.githubusercontent.com/u/175949671?v=4" width="42;" alt="openapphub"/></a>
|
||||
<a href="https://github.com/onewesong" title="onewesong"><img src="https://avatars.githubusercontent.com/u/17920822?v=4" width="42;" alt="onewesong"/></a>
|
||||
<a href="https://github.com/miclon-dev" title="miclon-dev"><img src="https://avatars.githubusercontent.com/u/111753685?v=4" width="42;" alt="miclon-dev"/></a>
|
||||
<a href="https://github.com/lykjjj" title="lykjjj"><img src="https://avatars.githubusercontent.com/u/58510058?v=4" width="42;" alt="lykjjj"/></a>
|
||||
<a href="https://github.com/lozhu20" title="lozhu"><img src="https://avatars.githubusercontent.com/u/44923922?v=4" width="42;" alt="lozhu"/></a>
|
||||
<a href="https://github.com/y52y" title="Zyj"><img src="https://avatars.githubusercontent.com/u/51304324?v=4" width="42;" alt="Zyj"/></a>
|
||||
<a href="https://github.com/isecret" title="Mao Wang"><img src="https://avatars.githubusercontent.com/u/15724152?v=4" width="42;" alt="Mao Wang"/></a>
|
||||
<a href="https://github.com/lvelvee" title="Lve Lvee"><img src="https://avatars.githubusercontent.com/u/25785753?v=4" width="42;" alt="Lve Lvee"/></a>
|
||||
<a href="https://github.com/likeadmin-likeshop" title="likeadmin通过管理后台-likeshop全开源商城"><img src="https://avatars.githubusercontent.com/u/77180968?v=4" width="42;" alt="likeadmin通过管理后台-likeshop全开源商城"/></a>
|
||||
@ -427,6 +428,8 @@ Quick Reference
|
||||
<a href="https://github.com/dousha0w0" title="dousha0w0"><img src="https://avatars.githubusercontent.com/u/52566311?v=4" width="42;" alt="dousha0w0"/></a>
|
||||
<a href="https://github.com/JinchuanL" title="ANDY"><img src="https://avatars.githubusercontent.com/u/68026794?v=4" width="42;" alt="ANDY"/></a>
|
||||
<a href="https://github.com/13812700839" title="花殇"><img src="https://avatars.githubusercontent.com/u/58072506?v=4" width="42;" alt="花殇"/></a>
|
||||
<a href="https://github.com/Lmmmmmm-bb" title="_lmmmmmm"><img src="https://avatars.githubusercontent.com/u/54026110?v=4" width="42;" alt="_lmmmmmm"/></a>
|
||||
<a href="https://github.com/y52y" title="Zyj"><img src="https://avatars.githubusercontent.com/u/51304324?v=4" width="42;" alt="Zyj"/></a>
|
||||
<a href="https://github.com/Leaderzhangyi" title="ZinkCas"><img src="https://avatars.githubusercontent.com/u/46915666?v=4" width="42;" alt="ZinkCas"/></a>
|
||||
<a href="https://github.com/zhu0629" title="zhucong"><img src="https://avatars.githubusercontent.com/u/13188450?v=4" width="42;" alt="zhucong"/></a>
|
||||
<a href="https://github.com/yikuaibro" title="yikuaibro"><img src="https://avatars.githubusercontent.com/u/44493045?v=4" width="42;" alt="yikuaibro"/></a>
|
||||
@ -453,8 +456,7 @@ Quick Reference
|
||||
<a href="https://github.com/mo3et" title="Monet Lee"><img src="https://avatars.githubusercontent.com/u/34803812?v=4" width="42;" alt="Monet Lee"/></a>
|
||||
<a href="https://github.com/Moeyuuko" title="Moeyuuko"><img src="https://avatars.githubusercontent.com/u/14266681?v=4" width="42;" alt="Moeyuuko"/></a>
|
||||
<a href="https://github.com/malcolmyu" title="Minghao Yu"><img src="https://avatars.githubusercontent.com/u/3203962?v=4" width="42;" alt="Minghao Yu"/></a>
|
||||
<a href="https://github.com/Mieriki" title="Mieriki"><img src="https://avatars.githubusercontent.com/u/142009318?v=4" width="42;" alt="Mieriki"/></a>
|
||||
<a href="https://github.com/mariuszmichalowski" title="Mariusz Michalowski"><img src="https://avatars.githubusercontent.com/u/92091891?v=4" width="42;" alt="Mariusz Michalowski"/></a><!--GAMFC-END-->
|
||||
<a href="https://github.com/Mieriki" title="Mieriki"><img src="https://avatars.githubusercontent.com/u/142009318?v=4" width="42;" alt="Mieriki"/></a><!--GAMFC-END-->
|
||||
|
||||
[贡献者](https://github.com/jaywcjlove/reference/graphs/contributors)列表,由 [contributors](https://github.com/jaywcjlove/github-action-contributors) 根据提交次数的先后顺序自动生成
|
||||
<!--rehype:style=padding-top:1rem;-->
|
||||
@ -571,6 +573,32 @@ Quick Reference
|
||||
|
||||
- [Quick Reference for VSCode](https://marketplace.visualstudio.com/items?itemName=jackiotyu.quick-reference) 由 [jackiotyu](https://github.com/jackiotyu/vscode-quick-reference) 提供
|
||||
|
||||
## 赞助支持
|
||||
<!--rehype:wrap-style=text-align: center;max-width: 650px;margin: 0 auto;&class=home-title-reset-->
|
||||
|
||||
非常感谢那些一直支持我开源工作的朋友们。如果您对我的工作感到满意,可以选择在[这里进行赞助](https://wangchujiang.com/#/sponsor)<!--rehype:target=_blank-->。如果目前经济上不宽裕,也可以通过下载并使用我开发的 [macOS 应用](https://wangchujiang.com/#/app)<!--rehype:target=_blank-->来支持我。以下是我个人开发的 macOS 应用:
|
||||
|
||||
<p style="display: inline-block">
|
||||
<a target="_blank" href="https://wangchujiang.com/daybar/" title="DayBar for macOS"><img align="center" alt="DayBar" height="50" width="50" src="https://github.com/user-attachments/assets/b67d4a2e-92e2-4d8c-8c6f-2a1eb3e2fa93"></a>
|
||||
<a target="_blank" href="https://wangchujiang.com/iconed/" title="Iconed for macOS"><img align="center" alt="Iconed" height="50" width="50" src="https://github.com/user-attachments/assets/8a35dc7b-4faf-4e2a-9311-f66d6844a896"></a>
|
||||
<a target="_blank" href="https://wangchujiang.com/rightmenu-master/" title="RightMenu Master for macOS"><img align="center" alt="RightMenu Master" height="50" width="50" src="https://github.com/user-attachments/assets/39a76541-71bf-4de7-a01c-c62f0557dff5"></a>
|
||||
<a target="_blank" href="https://wangchujiang.com/paste-quick/" title="Paste Quick for macOS"><img align="center" alt="Quick RSS" height="50" width="50" src="https://github.com/user-attachments/assets/bdaad5b7-9810-44ce-8f17-8410864465d2"></a>
|
||||
<a target="_blank" href="https://wangchujiang.com/quick-rss/" title="Quick RSS for macOS/iOS"><img align="center" alt="Quick RSS" height="50" width="50" src="https://github.com/user-attachments/assets/374106b5-a448-4d1d-9ccb-b04b6bc681ed"></a>
|
||||
<a target="_blank" href="https://wangchujiang.com/web-serve/" title="Web Serve for macOS"><img align="center" alt="Web Serve" height="50" width="50" src="https://github.com/user-attachments/assets/e1d9f76f-0f3d-4ba5-8a15-253ee173bb1c"></a>
|
||||
<a target="_blank" href="https://wangchujiang.com/copybook-generator/" title="Copybook Generator for macOS/iOS"><img align="center" alt="Copybook Generator" height="50" width="50" src="https://github.com/jaywcjlove/jaywcjlove/assets/1680273/b90e42ff-158b-4534-82ca-5898fd0e8d73"></a>
|
||||
<a target="_blank" href="https://wangchujiang.com/devtutor/" title="DevTutor for macOS/iOS"><img align="center" alt="DevTutor for SwiftUI" height="50" width="50" src="https://github.com/jaywcjlove/jaywcjlove/assets/1680273/f15c154d-0192-48eb-8e0e-9e245ffd974a"></a>
|
||||
<a target="_blank" href="https://wangchujiang.com/regex-mate/" title="RegexMate for macOS/iOS"><img align="center" alt="RegexMate" height="50" width="50" src="https://github.com/jaywcjlove/jaywcjlove/assets/1680273/aabe5aa9-9a96-4390-8bed-c3e4023d0dea"></a>
|
||||
<a target="_blank" href="https://wangchujiang.com/time-passage/" title="Time Passage for macOS/iOS"><img align="center" alt="Time Passage" height="50" width="50" src="https://github.com/jaywcjlove/time-passage/assets/1680273/6f30e429-e6f3-4dbe-9921-a5effe2a05e9"></a>
|
||||
<a target="_blank" href="https://wangchujiang.com/IconizeFolder/" title="IconizeFolder for macOS"><img align="center" alt="Iconize Folder" height="50" width="50" src="https://github.com/jaywcjlove/jaywcjlove/assets/1680273/fa9d8b9c-1e51-4ded-877c-fa5b21c47220"></a>
|
||||
<a target="_blank" href="https://wangchujiang.com/TextSoundSaver/" title="Textsound Saver for macOS/iOS"><img align="center" alt="Textsound Saver" height="50" width="50" src="https://github.com/jaywcjlove/jaywcjlove/assets/1680273/0595e842-980b-4574-8891-a8ba853a08be"></a>
|
||||
<a target="_blank" href="https://wangchujiang.com/create-custom-symbols/" title="Create Custom Symbols for macOS"><img align="center" alt="Create Custom Symbols" height="50" width="50" src="https://github.com/jaywcjlove/jaywcjlove/assets/1680273/8cd022ce-a3f1-4e89-b7c6-6fbd0d4db77c"></a>
|
||||
<a target="_blank" href="https://wangchujiang.com/DevHub/" title="DevHub for macOS"><img align="center" alt="DevHub" height="50" width="50" src="https://github.com/user-attachments/assets/4a44a4fd-67ce-430b-af0a-72f18feaa47d"></a>
|
||||
<a target="_blank" href="https://wangchujiang.com/ResumeRevise/" title="Resume Revise for macOS"><img align="center" alt="Resume Revise" height="50" width="50" src="https://github.com/jaywcjlove/jaywcjlove/assets/1680273/c9954a20-1905-48de-bdf8-d71837974aa2"></a>
|
||||
<a target="_blank" href="https://wangchujiang.com/palette-genius/" title="Palette Genius for macOS"><img align="center" alt="Palette Genius" height="50" width="50" src="https://github.com/jaywcjlove/jaywcjlove/assets/1680273/27340413-d355-45b2-8f6f-6ac37682d957"></a>
|
||||
<a target="_blank" href="https://wangchujiang.com/symbol-scribe/" title="Symbol Scribe for macOS"><img align="center" alt="Symbol Scribe" height="50" width="50" src="https://github.com/jaywcjlove/jaywcjlove/assets/1680273/c7249f05-fa70-4def-a1e9-571d5f171fc9"></a>
|
||||
</p>
|
||||
<!--rehype:style=padding-top:1rem;max-width: 520px;margin: 0 auto;-->
|
||||
|
||||
<!--rehype:ignore:start-->
|
||||
## 开发
|
||||
|
||||
|
592
docs/c.md
592
docs/c.md
@ -7,7 +7,6 @@ C 备忘清单
|
||||
----
|
||||
|
||||
### hello.c
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
```c
|
||||
#include <stdio.h>
|
||||
@ -35,30 +34,51 @@ $ ./hello
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
```c
|
||||
int myNum = 15;
|
||||
int myNum = 15; // 定义并初始化变量 myNum
|
||||
int myNum2; // 声明变量 myNum2
|
||||
myNum2 = 15; // 初始化变量 myNum2
|
||||
|
||||
int myNum2; // 声明变量 myNum2
|
||||
// 变量声明后第一次赋值我们称为初始化
|
||||
// 如果 初始化 和 赋值 在同一行
|
||||
// 那么我们可以直接称为 定义变量 myNum2
|
||||
myNum2 = 15;
|
||||
int myNum3 = 15; // 定义并初始化变量 myNum3
|
||||
myNum3 = 10; // 重新赋值 myNum3
|
||||
```
|
||||
|
||||
int myNum3 = 15; // myNum3 值为 15
|
||||
myNum3 = 10; // 现在 myNum3 值为 10
|
||||
定义不同类型的变量
|
||||
|
||||
float myFloatNum = 5.99; // 浮点数
|
||||
char myLetter = 'D'; // 字符
|
||||
```c
|
||||
// 定义并初始化浮点数变量
|
||||
float myFloatNum = 5.99;
|
||||
// 定义并初始化字符变量
|
||||
char myLetter = 'D';
|
||||
```
|
||||
|
||||
int x = 5;
|
||||
int y = 6;
|
||||
int sum = x + y; // 添加变量相加
|
||||
// 声明多个变量
|
||||
变量相加
|
||||
|
||||
```c
|
||||
int x = 5, y = 6;
|
||||
int sum = x + y; // 变量相加
|
||||
```
|
||||
|
||||
声明并初始化多个变量
|
||||
|
||||
```c
|
||||
int x = 5, y = 6, z = 50;
|
||||
int a, b, c = 10;
|
||||
```
|
||||
|
||||
仅声明变量不初始化
|
||||
|
||||
```c
|
||||
int result;
|
||||
// 未初始化的变量 result 会导致不可预测的结果
|
||||
|
||||
result = result + 10; // 错误:未初始化的变量
|
||||
// 部分编译器会警告未初始化的变量可能导致未定义行为
|
||||
```
|
||||
|
||||
### 常量 Constants
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
常量在 C 语言中我们一般理解为不能被改变的值,活用常量与符号常量
|
||||
常量是不能被改变的值,使用常量可以使代码更清晰和安全。
|
||||
|
||||
```c
|
||||
const int minutesPerHour = 60;
|
||||
@ -71,15 +91,54 @@ const float PI = 3.14;
|
||||
const int BIRTHYEAR = 1980;
|
||||
```
|
||||
|
||||
#### **命名规范**
|
||||
<!--rehype:style=text-align: left;-->
|
||||
|
||||
常量通常使用全大写字母,单词间用下划线分隔(如 BIRTHYEAR、MAX_LENGTH)。
|
||||
|
||||
#### **数组大小**
|
||||
<!--rehype:style=text-align: left;-->
|
||||
|
||||
使用 `const` 定义数组大小,编译器将其作为编译时常量处理。
|
||||
|
||||
#### **`#define` 与 `const`**
|
||||
<!--rehype:style=text-align: left;-->
|
||||
|
||||
- `#define`:宏常量在预处理阶段替换,不进行类型检查
|
||||
- `const`:类型安全的常量,编译器可检查类型,推荐使用
|
||||
|
||||
#### **注意事项**
|
||||
|
||||
- `const` 常量在定义时必须初始化,否则会导致编译错误。
|
||||
- `const` 常量的值不能被修改,任何尝试修改 `const` 常量的操作都会导致编译错误。
|
||||
- 使用 `const` 常量可以提高代码的可读性和可维护性,避免魔法数字的使用。
|
||||
|
||||
### 注释
|
||||
|
||||
```c
|
||||
// 这是一个注释
|
||||
printf("Hello World!"); // 这是一个注释
|
||||
/* 多行注释,上面的代码将打印出 Hello World!
|
||||
到屏幕上,真是太棒了 */
|
||||
// 这是一个单行注释
|
||||
printf("Hello World!"); // 行内注释
|
||||
|
||||
/*
|
||||
多行注释:
|
||||
用于注释跨多行的内容
|
||||
注意:多行注释不能嵌套,否则会导致编译错误
|
||||
*/
|
||||
```
|
||||
|
||||
**注意**:
|
||||
|
||||
- 单行注释 `//` 可以嵌套,如 `/////`。
|
||||
- 行内注释应避免过长,以免影响代码可读性。
|
||||
- 多行注释不能嵌套,否则会导致编译错误。
|
||||
|
||||
```c
|
||||
/* 这是一个多行注释的开始
|
||||
/* 嵌套的多行注释,C语言不支持 */
|
||||
*/
|
||||
```
|
||||
<!--rehype:style=background:#ff000030;-->
|
||||
|
||||
### 打印文本
|
||||
|
||||
```c
|
||||
@ -93,20 +152,34 @@ printf("Value = %f", f);
|
||||
short a = 0b1010110; // 2 进制数字
|
||||
int b = 02713; // 8 进制数字
|
||||
long c = 0X1DAB83; // 16 进制数字
|
||||
```
|
||||
|
||||
// 以 8 进制形似输出
|
||||
变量a和c分别为 `short` 和 `long` 型,所以输出必须加上对应的修饰符 `h` 和 `l`
|
||||
|
||||
#### 以 8 进制形式输出
|
||||
|
||||
```c
|
||||
printf("a=%ho, b=%o, c=%lo\n", a, b, c);
|
||||
// 输出 => a=126, b=2713, c=7325603
|
||||
```
|
||||
|
||||
// 以 10 进制形式输出
|
||||
#### 以 10 进制形式输出
|
||||
|
||||
```c
|
||||
printf("a=%hd, b=%d, c=%ld\n", a, b, c);
|
||||
// 输出 => a=86, b=1483, c=1944451
|
||||
```
|
||||
|
||||
// 以 16 进制形式输出(字母小写)
|
||||
#### 以 16 进制形式输出(字母小写)
|
||||
|
||||
```c
|
||||
printf("a=%hx, b=%x, c=%lx\n", a, b, c);
|
||||
// 输出 => a=56, b=5cb, c=1dab83
|
||||
```
|
||||
|
||||
// 以 16 进制形式输出(字母大写)
|
||||
#### 以 16 进制形式输出(字母大写)
|
||||
|
||||
```c
|
||||
printf("a=%hX, b=%X, c=%lX\n", a, b, c);
|
||||
// 输出 => a=56, b=5CB, c=1DAB83
|
||||
```
|
||||
@ -119,6 +192,7 @@ int b1=56720, b2=9999, b3=20098;
|
||||
int c1=233, c2=205, c3=1;
|
||||
int d1=34, d2=0, d3=23;
|
||||
|
||||
// %-9d: 十进制输出,最少宽度为9,左对齐
|
||||
printf("%-9d %-9d %-9d\n", a1, a2, a3);
|
||||
printf("%-9d %-9d %-9d\n", b1, b2, b3);
|
||||
printf("%-9d %-9d %-9d\n", c1, c2, c3);
|
||||
@ -134,45 +208,75 @@ printf("%-9d %-9d %-9d\n", d1, d2, d3);
|
||||
34 0 23
|
||||
```
|
||||
|
||||
`%-9d` 中,`d` 表示以 `10` 进制输出,`9` 表示最少占 `9` 个字符的宽度,宽度不足以空格补齐,`-` 表示左对齐
|
||||
解释:`%-9d`:`d` 表示十进制输出,`9` 表示最少占 9 个字符宽度,`-` 表示左对齐,不使用 `-` 则默认右对齐。
|
||||
|
||||
### 字符串 Strings
|
||||
对于整型数据:
|
||||
|
||||
```c
|
||||
int a = 12345;
|
||||
printf("%md", a);
|
||||
```
|
||||
|
||||
- 若 `m <=` 实际数据宽度,则按实际情况输出。
|
||||
- 若 `m >` 实际数据宽度,则在左边用空格补齐。
|
||||
- `printf("%0md", a);` 则在左边用 `0` 补齐。
|
||||
|
||||
对于浮点型数据:
|
||||
|
||||
```c
|
||||
float a = 1.2345;
|
||||
printf("%m.nf", a);
|
||||
// m -- 整个数据宽度,n -- 小数位数
|
||||
```
|
||||
|
||||
- 实际小数位数 `> n`,截去多余小数,注意四舍五入。
|
||||
- 实际小数位数 `< n`,在小数最后补 `0`。
|
||||
- 若 `m` 省略则写作 `%.n`,整数部分按实际输出,小数部分按以上规则。
|
||||
- 若 `m < n+1`,自动突破宽度限制,按实际数据输出。
|
||||
- 若 `m > n+1`,左边补空格。
|
||||
|
||||
### 字符串 (Strings)
|
||||
|
||||
在 C 语言中,字符串是以 `\0` 结尾的字符数组,而不是一种单独的数据类型。可以通过字符数组来表示字符串。
|
||||
|
||||
#### 定义并打印字符串
|
||||
|
||||
```c
|
||||
char greetings[] = "Hello World!";
|
||||
printf("%s", greetings);
|
||||
```
|
||||
|
||||
访问字符串
|
||||
#### 访问字符串中的字符
|
||||
|
||||
```c
|
||||
char greetings[] = "Hello World!";
|
||||
printf("%c", greetings[0]);
|
||||
```
|
||||
|
||||
修改字符串
|
||||
访问字符串 `greetings` 的第一个字符 `H`
|
||||
|
||||
#### 修改字符串中的字符
|
||||
|
||||
```c
|
||||
char greetings[] = "Hello World!";
|
||||
greetings[0] = 'J';
|
||||
greetings[0] = 'J'; // 修改第一个字符为 'J'
|
||||
|
||||
printf("%s", greetings);
|
||||
// 输出 "Jello World!"
|
||||
```
|
||||
|
||||
另一种创建字符串的方法
|
||||
#### 另一种创建字符串的方法
|
||||
|
||||
```c
|
||||
char greetings[] = {'H','e','l','l','\0'};
|
||||
|
||||
printf("%s", greetings);
|
||||
// 输出 "Hell!"
|
||||
// 输出 "Hell"
|
||||
```
|
||||
|
||||
`C` **没有** String 类型,使用 `char` 类型并创建一个字符 `array`
|
||||
**注意**:C 语言中没有 `String` 类型,字符串是由字符数组 `char[]` 表示的,且必须以 `\0` 结尾以标识字符串的结束。
|
||||
|
||||
### 条件判断
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
```c
|
||||
int time = 20;
|
||||
@ -182,6 +286,7 @@ if (time < 18) {
|
||||
printf("晚上好!");
|
||||
}
|
||||
// 输出 -> "晚上好!"
|
||||
|
||||
int time = 22;
|
||||
if (time < 10) {
|
||||
printf("早上好!");
|
||||
@ -191,14 +296,52 @@ if (time < 10) {
|
||||
printf("晚上好!");
|
||||
}
|
||||
// 输出 -> "晚上好!"
|
||||
|
||||
int time = 10;
|
||||
if (time > 8) {
|
||||
//再嵌套一个if
|
||||
if (time < 12) {
|
||||
printf("中午好!")
|
||||
}
|
||||
}
|
||||
// 输出 -> "中午好!"
|
||||
```
|
||||
|
||||
#### 说明
|
||||
|
||||
- `if` 语句用于根据条件执行代码块。
|
||||
- `else` 语句在 `if` 条件不满足时执行。
|
||||
- `else if` 语句用于检查多个条件。
|
||||
- 可以嵌套 `if` 语句以检查多个条件。
|
||||
|
||||
### 三元运算符
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
三元运算符(`? :`)是一种简洁的条件判断方式,用于根据条件选择表达式的值。由三个部分组成:
|
||||
|
||||
- 条件表达式
|
||||
- 条件为真时的结果
|
||||
- 条件为假时的结果
|
||||
|
||||
基本语法:`(条件) ? 表达式1 : 表达式2;`
|
||||
如果 `条件` 为真,则返回 `表达式1`,否则返回 `表达式2`。
|
||||
|
||||
#### 示例
|
||||
|
||||
```c
|
||||
int time = 20;
|
||||
(time < 18) ? printf("再会!") : printf("晚上好!");
|
||||
(time < 18) ? printf("再会!")
|
||||
: printf("晚上好!");
|
||||
// 输出 -> "晚上好!"
|
||||
```
|
||||
|
||||
嵌套使用示例(不建议过多嵌套):
|
||||
|
||||
```c
|
||||
int time = 22;
|
||||
printf((time < 10) ? "早上好!"
|
||||
: (time < 20) ? "再会!"
|
||||
: "晚上好!");
|
||||
// 输出 -> "晚上好!"
|
||||
```
|
||||
|
||||
### Switch
|
||||
@ -209,10 +352,36 @@ int day = 4;
|
||||
switch (day) {
|
||||
case 3: printf("周三"); break;
|
||||
case 4: printf("周四"); break;
|
||||
default:
|
||||
printf("期待周末");
|
||||
default: printf("期待周末");
|
||||
}
|
||||
// 输出 -> "周四" (day 4)
|
||||
// 输出 -> "周四"
|
||||
```
|
||||
|
||||
#### 说明
|
||||
|
||||
- `switch` 语句根据表达式的值跳转到匹配的 `case` 标签。
|
||||
- 匹配到 `case` 后执行相应代码,并通过 `break` 跳出 `switch`。
|
||||
- 如果没有匹配到任何 `case`,则执行 `default` 语句(如果存在)。
|
||||
|
||||
#### 注意事项
|
||||
|
||||
- `switch` 表达式可以是整型、字符型和枚举型。
|
||||
- `case` 后的常量表达式值不能相同。
|
||||
- `case` 后可以有多个语句,不需要 `{ }` 括起来。
|
||||
- `case` 和 `default` 语句的顺序不影响程序执行结果。
|
||||
- `break` 语句用于结束 `switch`,如果没有 `break`,程序会继续执行下一个 `case`。
|
||||
|
||||
#### 示例
|
||||
|
||||
```c
|
||||
int day = 3;
|
||||
|
||||
switch (day) {
|
||||
case 3: printf("周三");
|
||||
case 4: printf("周四"); break;
|
||||
default: printf("期待周末");
|
||||
}
|
||||
// 输出 -> "周三周四"
|
||||
```
|
||||
|
||||
### While 循环
|
||||
@ -224,9 +393,53 @@ while (i < 5) {
|
||||
printf("%d\n", i);
|
||||
i++;
|
||||
}
|
||||
// 输出 -> 0 1 2 3 4
|
||||
```
|
||||
|
||||
**注意**:不要忘记增加条件中使用的变量,否则循环永远不会结束,成为“死循环”!
|
||||
#### 解释
|
||||
|
||||
- `while` 循环首先检查条件 `i < 5` 是否为真。
|
||||
- 如果为真,程序进入循环体,执行打印操作并增加 `i` 的值。
|
||||
- 循环会继续进行,直到 `i` 达到 5,此时条件 `i < 5` 不再为真,循环结束。
|
||||
|
||||
#### 打印 1 到 10 的数字
|
||||
|
||||
```c
|
||||
int i = 1;
|
||||
|
||||
while (i <= 10) {
|
||||
printf("%d\n", i);
|
||||
i++;
|
||||
}
|
||||
// 输出 -> 1 2 3 4 5 6 7 8 9 10
|
||||
```
|
||||
|
||||
#### 打印偶数
|
||||
|
||||
```c
|
||||
int i = 0;
|
||||
|
||||
while (i <= 10) {
|
||||
if (i % 2 == 0) {
|
||||
printf("%d\n", i);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
// 输出 -> 0 2 4 6 8 10
|
||||
```
|
||||
|
||||
#### 无限循环(需手动终止)
|
||||
|
||||
```c
|
||||
int i = 0;
|
||||
|
||||
while (1) {
|
||||
printf("无限循环\n");
|
||||
i++;
|
||||
if (i == 5) break; // 添加条件以退出循环
|
||||
}
|
||||
// 输出 -> 无限循环 (打印 5 次)
|
||||
```
|
||||
|
||||
### Do/While 循环
|
||||
|
||||
@ -237,20 +450,83 @@ do {
|
||||
printf("%d\n", i);
|
||||
i++;
|
||||
} while (i < 5);
|
||||
// 输出 -> 0 1 2 3 4
|
||||
```
|
||||
|
||||
#### 解释
|
||||
|
||||
- `do/while` 循环至少执行一次循环体,因为条件检查在循环体执行之后进行。
|
||||
- 首先执行 `do` 中的代码,然后检查条件 `i < 5` 是否为真。
|
||||
- 如果为真,继续执行循环;如果为假,则退出循环。
|
||||
|
||||
#### 打印从 5 开始的数字,直到条件不满足
|
||||
|
||||
```c
|
||||
int i = 5;
|
||||
|
||||
do {
|
||||
printf("%d\n", i); // 输出 5
|
||||
i++;
|
||||
} while (i < 5);
|
||||
// 输出 -> 5
|
||||
```
|
||||
|
||||
#### 计算 1 到 10 的和
|
||||
|
||||
```c
|
||||
int i = 1;
|
||||
int sum = 0;
|
||||
|
||||
do {
|
||||
sum += i;
|
||||
i++;
|
||||
} while (i <= 10);
|
||||
|
||||
printf("Sum: %d\n", sum);
|
||||
// 输出 -> Sum: 55
|
||||
```
|
||||
|
||||
### For 循环
|
||||
|
||||
```c
|
||||
for (表达式1; 表达式2; 表达式3) {
|
||||
循环体语句;
|
||||
}
|
||||
```
|
||||
|
||||
- 表达式1:设置初始条件,只执行一次。
|
||||
- 表达式2:循环条件表达式,每次循环前检查。
|
||||
- 表达式3:循环体执行后的调整操作。
|
||||
|
||||
示例:
|
||||
|
||||
```c
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 5; i++) {
|
||||
printf("%d\n", i);
|
||||
}
|
||||
// 输出 -> 0 1 2 3 4
|
||||
```
|
||||
|
||||
### 跳出循环 Break/Continue
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
#### 注意事项
|
||||
|
||||
- `for` 语句的三个表达式不是必须的。
|
||||
- 当条件表达式(表达式2)为假时,`for` 循环结束。
|
||||
- 可以在循环体内使用 `break`、`continue`、`goto` 语句。
|
||||
- 如果表达式2为空,则表示无限循环,如 `for(;;)` 相当于 `while(1)`。
|
||||
|
||||
#### 变体
|
||||
|
||||
- `for (i = m; i < n; i++)` 从 `i = m` 开始到 `i = n-1`,循环 `n - m` 次。
|
||||
- `for (i = m; i <= n; i++)` 从 `i = m` 到 `i = n`,循环 `n - m + 1` 次。
|
||||
|
||||
### 跳出循环 (Break/Continue/Goto)
|
||||
<!--rehype:wrap-class=row-span-3-->
|
||||
|
||||
#### `break` 语句
|
||||
|
||||
跳出当前循环或 `switch` 语句,执行后续代码。
|
||||
|
||||
```c
|
||||
int i;
|
||||
@ -261,9 +537,12 @@ for (i = 0; i < 10; i++) {
|
||||
}
|
||||
printf("%d\n", i);
|
||||
}
|
||||
// 输出 -> 0 1 2 3
|
||||
```
|
||||
|
||||
在 `i` 等于 `4` 时跳出循环
|
||||
#### `continue` 语句
|
||||
|
||||
跳过当前循环的剩余语句,直接进入下一次循环。
|
||||
|
||||
```c
|
||||
int i;
|
||||
@ -274,72 +553,40 @@ for (i = 0; i < 10; i++) {
|
||||
}
|
||||
printf("%d\n", i);
|
||||
}
|
||||
// 输出 -> 0 1 2 3 5 6 7 8 9
|
||||
```
|
||||
|
||||
示例跳过 `4` 的值
|
||||
#### `goto` 语句
|
||||
|
||||
### While Break 示例
|
||||
无条件跳转到指定标签位置。
|
||||
|
||||
```c
|
||||
int i = 0;
|
||||
|
||||
while (i < 10) {
|
||||
if (i == 4) {
|
||||
break;
|
||||
goto skip; // 跳转到 skip 标签
|
||||
}
|
||||
printf("%d\n", i);
|
||||
i++;
|
||||
}
|
||||
|
||||
skip:
|
||||
printf("Exited the loop at i = %d\n", i);
|
||||
// 输出 -> 0 1 2 3 Exited the loop at i = 4
|
||||
```
|
||||
|
||||
### While continue 示例
|
||||
#### 注意事项
|
||||
|
||||
- 标签必须在当前函数内定义,命名规则与变量相同。
|
||||
- `goto` 语句应慎用,避免代码逻辑混乱,通常使用循环或条件语句代替。
|
||||
|
||||
#### 设置数组大小
|
||||
|
||||
```c
|
||||
int i = 0;
|
||||
|
||||
while (i < 10) {
|
||||
i++;
|
||||
if (i == 4) {
|
||||
continue;
|
||||
}
|
||||
printf("%d\n", i);
|
||||
}
|
||||
```
|
||||
|
||||
### 数组 Arrays
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
```c
|
||||
int myNumbers[] = {25, 50, 75, 100};
|
||||
printf("%d", myNumbers[0]);
|
||||
// 输出 25
|
||||
```
|
||||
|
||||
更改数组元素
|
||||
|
||||
```c
|
||||
int myNumbers[] = {25, 50, 75, 100};
|
||||
myNumbers[0] = 33;
|
||||
|
||||
printf("%d", myNumbers[0]);
|
||||
```
|
||||
|
||||
循环遍历数组
|
||||
|
||||
```c
|
||||
int myNumbers[] = {25, 50, 75, 100};
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
printf("%d\n", myNumbers[i]);
|
||||
}
|
||||
```
|
||||
|
||||
设置数组大小
|
||||
|
||||
```c
|
||||
// 声明一个由四个整数组成的数组:
|
||||
// 声明一个由四个整数组成的数组
|
||||
int myNumbers[4];
|
||||
|
||||
// 添加元素
|
||||
myNumbers[0] = 25;
|
||||
myNumbers[1] = 50;
|
||||
@ -387,6 +634,35 @@ switch(day){
|
||||
}
|
||||
```
|
||||
|
||||
### 数组 Arrays
|
||||
|
||||
#### 定义和访问数组元素
|
||||
|
||||
```c
|
||||
int myNumbers[] = {25, 50, 75, 100};
|
||||
printf("%d", myNumbers[0]); // 输出 25
|
||||
```
|
||||
|
||||
#### 更改数组元素
|
||||
|
||||
```c
|
||||
int myNumbers[] = {25, 50, 75, 100};
|
||||
myNumbers[0] = 33;
|
||||
printf("%d", myNumbers[0]); // 输出 33
|
||||
```
|
||||
|
||||
#### 循环遍历数组
|
||||
|
||||
```c
|
||||
int myNumbers[] = {25, 50, 75, 100};
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
printf("%d\n", myNumbers[i]);
|
||||
}
|
||||
// 输出 -> 25 50 75 100
|
||||
```
|
||||
|
||||
### 用户输入
|
||||
|
||||
```c
|
||||
@ -418,39 +694,27 @@ printf("Hello %s.", firstName);
|
||||
|
||||
### 内存地址
|
||||
|
||||
创建变量时,会为该变量分配一个内存地址
|
||||
创建变量时,会为该变量分配一个内存地址。
|
||||
|
||||
```c
|
||||
int myAge = 43;
|
||||
|
||||
printf("%p", &myAge);
|
||||
// 输出:0x7ffe5367e044
|
||||
// 输出 myAge 的内存地址,例如:0x7ffe5367e044
|
||||
```
|
||||
|
||||
要访问它,请使用引用运算符 (`&`)
|
||||
要访问变量的内存地址,请使用引用运算符 (`&`)。
|
||||
|
||||
### 创建指针
|
||||
|
||||
```c
|
||||
int myAge = 43; // 一个 int 变量
|
||||
printf("%d", myAge); // 输出 myAge(43)的值
|
||||
|
||||
// 输出 myAge 的内存地址(0x7ffe5367e044)
|
||||
printf("%p", &myAge);
|
||||
```
|
||||
|
||||
### 指针变量
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
```c
|
||||
int myAge = 43; // 一个 int 变量
|
||||
int* ptr = &myAge; // 名为 ptr 的指针变量,用于存储 myAge 的地址
|
||||
int myAge = 43; // 一个 int 变量
|
||||
int *ptr = &myAge; // 创建指向 myAge 的指针
|
||||
|
||||
printf("%d\n", myAge); // 输出 myAge (43) 的值
|
||||
|
||||
printf("%p\n", &myAge); // 输出 myAge 的内存地址(0x7ffe5367e044)
|
||||
|
||||
printf("%p\n", ptr); // 用指针(0x7ffe5367e044)输出myAge的内存地址
|
||||
printf("%d\n", myAge); // 输出 myAge 的值 -> 43
|
||||
printf("%p\n", &myAge); // 输出 myAge 的内存地址,例如:0x7ffe5367e044
|
||||
printf("%p\n", ptr); // 输出指针 ptr 的值(即 myAge 的内存地址)
|
||||
printf("%d\n", *ptr); // 通过指针访问 myAge 的值 -> 43
|
||||
```
|
||||
|
||||
### 取消引用
|
||||
@ -466,6 +730,18 @@ printf("%p\n", ptr);
|
||||
printf("%d\n", *ptr);
|
||||
```
|
||||
|
||||
### 指针变量
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
```c
|
||||
int myAge = 43; // 一个 int 变量
|
||||
int* ptr = &myAge; // 名为 ptr 的指针变量,用于存储 myAge 的地址
|
||||
|
||||
printf("%d\n", myAge); // 输出 myAge (43) 的值
|
||||
printf("%p\n", &myAge); // 输出 myAge 的内存地址(0x7ffe5367e044)
|
||||
printf("%p\n", ptr); // 用指针(0x7ffe5367e044)输出myAge的内存地址
|
||||
```
|
||||
|
||||
运算符
|
||||
---
|
||||
|
||||
@ -805,6 +1081,100 @@ int main(void) {
|
||||
}
|
||||
```
|
||||
|
||||
### Warning 和 Error
|
||||
<!--rehype:wrap-class=row-span-2-->
|
||||
|
||||
在 C 语言中,警告(Warning)和错误(Error)是编译器用于标识代码潜在问题或阻止代码编译的机制。
|
||||
|
||||
#### 警告
|
||||
|
||||
警告提示代码中可能存在的问题,但不会阻止代码编译。处理警告可以提升代码质量和可移植性。
|
||||
|
||||
#### **常见警告示例**
|
||||
|
||||
未使用的变量
|
||||
|
||||
```c
|
||||
int x; printf("%d", x);
|
||||
```
|
||||
|
||||
类型隐式转换(可能导致数据丢失)
|
||||
|
||||
```c
|
||||
int x = 3.14; // 浮点数被隐式转换
|
||||
int a = 2147483647 + 1; // 可能溢出
|
||||
```
|
||||
|
||||
函数声明与定义不匹配
|
||||
|
||||
#### 错误
|
||||
|
||||
错误会阻止代码编译,必须修复才能继续编译。
|
||||
|
||||
**常见错误示例**:
|
||||
|
||||
语法错误(如缺少分号)
|
||||
|
||||
```c
|
||||
int x = 1
|
||||
```
|
||||
|
||||
函数定义冲突
|
||||
|
||||
```c
|
||||
void func(int);
|
||||
void func(double);
|
||||
```
|
||||
|
||||
函数或变量未定义
|
||||
|
||||
```c
|
||||
y = 10; printf("%d", y);
|
||||
```
|
||||
|
||||
头文件缺失或冲突
|
||||
|
||||
```c
|
||||
#include <unknown.h>
|
||||
```
|
||||
|
||||
### 使用编译器指令控制警告和错误
|
||||
<!--rehype:wrap-class=col-span-2-->
|
||||
|
||||
#### 抑制警告
|
||||
|
||||
可以使用编译器选项来关闭特定的警告,例如在 GCC 中:
|
||||
|
||||
```sh
|
||||
gcc -w file.c # 禁用所有警告
|
||||
gcc -Wall file.c # 启用所有常见警告
|
||||
gcc -Werror file.c # 将警告视为错误
|
||||
```
|
||||
|
||||
#### 使用 `#pragma` 控制警告
|
||||
|
||||
在某些编译器中,可以使用 `#pragma` 指令启用或禁用警告:
|
||||
|
||||
```c
|
||||
#include <stdio.h>
|
||||
#pragma warning(disable : 4996) // 禁用警告(适用于 MSVC 编译器)
|
||||
|
||||
int main() {
|
||||
printf("Hello, world!");
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
#### 总结
|
||||
|
||||
| 区别点 | Warning(警告) | Error(错误) |
|
||||
|------------------|----------------------------------------|----------------------------------------|
|
||||
| 严重程度 | 程序可继续编译,但可能存在隐患 | 编译无法完成,必须修复 |
|
||||
| 编译结果 | 生成可执行文件 | 无法生成可执行文件 |
|
||||
| 触发原因 | 潜在问题,例如隐式转换或未使用的变量 | 语法或语义错误,例如语法错误或未定义变量 |
|
||||
| 修复必要性 | 可选择修复,但建议修复以避免潜在问题 | 必须修复才能继续编译 |
|
||||
| 编译器选项调整 | 可以忽略或转换为错误(如 `-Werror`) | 无法调整,必须修复 |
|
||||
|
||||
函数
|
||||
----
|
||||
|
||||
|
10
docs/java.md
10
docs/java.md
@ -242,10 +242,12 @@ sb.append("!");
|
||||
### 比较
|
||||
|
||||
```java
|
||||
String s1 = new String("QuickRef");
|
||||
String s1 = "QuickRef";
|
||||
String s2 = new String("QuickRef");
|
||||
s1 == s2 // false
|
||||
s1.equals(s2) // true
|
||||
s1 == s2 // false
|
||||
s1.equals(s2) // true
|
||||
// intern 方法获得字符串常量池中的惟一引用
|
||||
s1 == s2.intern() // true
|
||||
"AB".equalsIgnoreCase("ab") // true
|
||||
```
|
||||
|
||||
@ -310,7 +312,7 @@ int[] a3 = new int[]{1, 2, 3};
|
||||
int[] a4 = new int[3];
|
||||
a4[0] = 1;
|
||||
a4[2] = 2;
|
||||
a4[3] = 3;
|
||||
a4[3] = 3; // 会出现索引越界异常
|
||||
```
|
||||
|
||||
### 修改 Modify
|
||||
|
@ -32,7 +32,7 @@
|
||||
"lint-staged": "^15.0.0",
|
||||
"prettier": "^3.0.0",
|
||||
"refs-cli": "^1.8.0",
|
||||
"markdownlint": "^0.33.0",
|
||||
"markdownlint": "^0.37.0",
|
||||
"markdownlint-cli": "^0.39.0"
|
||||
},
|
||||
"engines": {
|
||||
|
Reference in New Issue
Block a user