-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathC-main().html
2219 lines (1630 loc) · 119 KB
/
C-main().html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html>
<!-- Head -->
<head>
<title>C语 概述(程序结构) - 我叫史迪奇</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="keywords" content="这是我的博客" />
<meta name="description" content="这是我的窝">
<!-- <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"> -->
<link rel="shortcut icon" href="https://s1.ax1x.com/2023/08/10/pPm8TPO.png" type="image/png" />
<link rel="stylesheet" type="text/css" href="//at.alicdn.com/t/font_2419798_axdw2lrqtkc.css">
<link rel="stylesheet" type="text/css" href="/css/bootstrap-3.3.4.css">
<link rel="stylesheet" href="/css/style.css">
<link rel="stylesheet" type="text/css" href="/css/social/social.css">
<link rel="stylesheet" type="text/css" href="/css/navEffect.css">
<link rel="stylesheet" type="text/css" href="/css/post_content.css">
<script src="/js/jquery1.10.2.min.js"></script>
<script src="/js/app.js"></script>
<script src="/js/bootstrap-3.3.4.js"></script>
<script src="/js/s.js"></script>
<script src="/js/jquery.slimscroll.min.js"></script>
<script src="/js/waline.js"></script>
<link href='https://unpkg.com/@waline/[email protected]/dist/waline.css' rel='stylesheet' />
<script src="/resources/loadingBar/pace.min.js"></script>
<script src="/js/headBand.min.js"></script>
<link rel="stylesheet" href="/resources/loadingBar/flash.css">
<script src="/js/highlight.min.js"></script>
<link rel="stylesheet" href="/css/code-style.css">
<link rel="stylesheet" href="/css/code-styles/sdqlightfair.min.css">
<script src="/js/mermaid.min.js"></script>
<script src="/js/katex.min.js"></script>
<link rel="stylesheet" href="/css/katex.min.css">
<link rel="stylesheet" href="/css/avatar_user.css">
<meta name="generator" content="Hexo 5.3.0"></head>
<!--
<link rel="stylesheet" type="text/css" href="/css/avatar_user.css"> -->
<!-- <script src='https://unpkg.com/@waline/[email protected]/dist/waline.js'></script> -->
<body class="pace-done layout-fullwidth">
<div id="sdq" style= "display:none" >
<!-- Header -->
<nav class="navbar navbar-default navbar-fixed-top">
<div class="brand">
<a>
<i id="sdq-logo" style="font-size:50px;vertical-align: middle;"
class=""></i>
</a>
<a href="/">
<span style="font-size: 20px;">我叫史迪奇</span>
</a>
</div>
<div class="nav-list">
<a href="/" title="首页">
<span>
首页
</span>
</a>
<a href="/about.html" title="关于">
<span>
关于
</span>
</a>
<a href="/valine.html" title="留言">
<span>
留言
</span>
</a>
<a href="/link.html" title="友链">
<span>
友链
</span>
</a>
</div>
<div class="mobile">
<div class="mobile-inner">
<div class="mobile-inner-header">
<div class="mobile-inner-header-icon mobile-inner-header-icon-out">
<span></span><span></span>
</div>
</div>
<div class="mobile-inner-nav">
<a href="/" title="首页">
<span>
首页
</span>
</a>
<a href="/about.html" title="关于">
<span>
关于
</span>
</a>
<a href="/valine.html" title="留言">
<span>
留言
</span>
</a>
<a href="/link.html" title="友链">
<span>
友链
</span>
</a>
</div>
</div>
</div>
<script>
$(window).load(function () {
$(".mobile-inner-header-icon").click(function(){
$(this).toggleClass("mobile-inner-header-icon-click mobile-inner-header-icon-out");
$(".mobile-inner-nav").slideToggle(250);
});
$(".mobile-inner-nav a").each(function( index ) {
$( this ).css({'animation-delay': (index/10)+'s'});
});
});
</script>
<div class="container-fluid">
<div class="navbar-btn" style="padding: 0; padding-top: 10px;">
<button type="button" class="btn-toggle-fullwidth btn-toggle-mx">
<i class="sdqMsDanIconFont"></i>
</button>
</div>
</div>
</nav>
<div id="sidebar-nav" class="sidebar">
<div class="sidebar-scroll">
<div class="sidebar-author">
<a href="/">
<img src="https://s1.ax1x.com/2023/08/10/pPm8IIK.jpg">
<img src="">
</a>
</div>
<nav>
<div class="sdq-count">
<span>文章</span>156
<span>标签</span>0
<span>分类</span>27
</div>
<div class="social-btns">
<a target="_blank" class="btn GitHub" href="https://github.com/sdqOS/">
<i class="sdqMsDanIconFont sdq3 sdqgithub"></i>
</a>
<a target="_blank" class="btn qq" href="https://wpa.qq.com/msgrd?v=3&uin=3083329400&site=qq&menu=yes">
<i class="sdqMsDanIconFont sdq3 sdqqq1"></i>
</a>
</div>
<div class="social-search">
<input id="local-search-input" />
<!-- <button class="sdq3 sdqfeiji"></button> -->
</div>
<style>
.search-result{
display: none;
}
.search-result-list li {
list-style: none;
line-height: 32px;
margin-bottom: 15px;
}
</style>
<div id="local-search-result"></div>
<script>
var search_path = "search.xml";
if (search_path.length == 0) {
search_path = "/search.xml";
}
var path = "/" + search_path;
searchFunc(path, 'local-search-input', 'local-search-result');
</script>
<ul class="nav">
<li>
<a target="_self" href="/" class="iframe_link active"><span>首页</span>
</a>
</li>
<li>
<a id="axis" target="_self" href="/axis.html" class="nav-togg">
<span>时间轴</span>
</a>
</li>
<li>
<a href="javascript:;" class="nav-togg" target="_self" ><span>文章分类</span>
</a>
<div>
<ul>
<li>
<a href="/categories/Android/">Android</a>
<span>4</span>
</li>
<li>
<a href="/categories/CSS/">CSS</a>
<span>11</span>
</li>
<li>
<a href="/categories/C语/">C语</a>
<span>11</span>
</li>
<li>
<a href="/categories/EJS/">EJS</a>
<span>1</span>
</li>
<li>
<a href="/categories/ES6/">ES6</a>
<span>2</span>
</li>
<li>
<a href="/categories/Git/">Git</a>
<span>1</span>
</li>
<li>
<a href="/categories/HTML/">HTML</a>
<span>3</span>
</li>
<li>
<a href="/categories/Java/">Java</a>
<span>7</span>
</li>
<li>
<a href="/categories/JavaScript/">JavaScript</a>
<span>13</span>
</li>
<li>
<a href="/categories/Linux/">Linux</a>
<span>5</span>
</li>
<li>
<a href="/categories/Python/">Python</a>
<span>5</span>
</li>
<li>
<a href="/categories/React/">React</a>
<span>20</span>
</li>
<li>
<a href="/categories/Three-js/">Three.js</a>
<span>3</span>
</li>
<li>
<a href="/categories/TypeScript/">TypeScript</a>
<span>13</span>
</li>
<li>
<a href="/categories/Vue-js/">Vue.js</a>
<span>4</span>
</li>
<li>
<a href="/categories/人工智能/">人工智能</a>
<span>2</span>
</li>
<li>
<a href="/categories/大数据/">大数据</a>
<span>3</span>
</li>
<li>
<a href="/categories/实用软件/">实用软件</a>
<span>1</span>
</li>
<li>
<a href="/categories/小程序开发/">小程序开发</a>
<span>6</span>
</li>
<li>
<a href="/categories/搭建博客/">搭建博客</a>
<span>1</span>
</li>
<li>
<a href="/categories/数据库/">数据库</a>
<span>3</span>
</li>
<li>
<a href="/categories/数据结构/">数据结构</a>
<span>2</span>
</li>
<li>
<a href="/categories/游戏/">游戏</a>
<span>1</span>
</li>
<li>
<a href="/categories/爬虫/">爬虫</a>
<span>23</span>
</li>
<li>
<a href="/categories/算法/">算法</a>
<span>1</span>
</li>
<li>
<a href="/categories/需求分析图/">需求分析图</a>
<span>1</span>
</li>
<li>
<a href="/categories/鲲鹏云/">鲲鹏云</a>
<span>4</span>
</li>
</ul>
</div>
</li>
<li>
<a href="javascript:;" class="nav-togg" target="_self" ><span>最新文章</span>
</a>
<div>
<ul>
<li>
<a href="/photo-video.html">手机照片视频恢复工具</a>
</li>
<li>
<a href="/Dad-n-Me.html">游戏篇 狂扁小朋友修仙版(攻略)</a>
</li>
<li>
<a href="/Spark.html">大数据 Spark</a>
</li>
<li>
<a href="/CSS-Flex.html">CSS Flex样式</a>
</li>
<li>
<a href="/CSS-Static-Relative-Absolute-Fixed-Sticky.html">CSS 定位布局</a>
</li>
</ul>
</div>
</li>
</ul>
</nav>
</div>
</div>
<style>
/* CSS */
.canvas {
position:fixed;
width: 1920px;
height: 862px;
left: -360px;
top: 0;
z-index: -1;
}
</style>
<div class="sdq-bg">
<div class="div_bg"></div>
</div>
<!-- Scripts -->
<script>
// 在这里写你的代码...
(function() {
"use strict";
var $body = document.querySelector('body');
/*$('body').addClass('is-preload'); 添加灰面遮罩,可能存在问题
//$('.sdq-bg').css('background','none'); */
// Methods/polyfills.
// classList | (c) @remy | github.com/remy/polyfills | rem.mit-license.org
!function(){function t(t){this.el=t;for(var n=t.className.replace(/^\s+|\s+$/g,"").split(/\s+/),i=0;i<n.length;i++)e.call(this,n[i])}function n(t,n,i){Object.defineProperty?Object.defineProperty(t,n,{get:i}):t.__defineGetter__(n,i)}if(!("undefined"==typeof window.Element||"classList"in document.documentElement)){var i=Array.prototype,e=i.push,s=i.splice,o=i.join;t.prototype={add:function(t){this.contains(t)||(e.call(this,t),this.el.className=this.toString())},contains:function(t){return-1!=this.el.className.indexOf(t)},item:function(t){return this[t]||null},remove:function(t){if(this.contains(t)){for(var n=0;n<this.length&&this[n]!=t;n++);s.call(this,n,1),this.el.className=this.toString()}},toString:function(){return o.call(this," ")},toggle:function(t){return this.contains(t)?this.remove(t):this.add(t),this.contains(t)}},window.DOMTokenList=t,n(Element.prototype,"classList",function(){return new t(this)})}}();
// canUse
window.canUse=function(p){if(!window._canUse)window._canUse=document.createElement("div");var e=window._canUse.style,up=p.charAt(0).toUpperCase()+p.slice(1);return p in e||"Moz"+up in e||"Webkit"+up in e||"O"+up in e||"ms"+up in e};
// window.addEventListener
(function(){if("addEventListener"in window)return;window.addEventListener=function(type,f){window.attachEvent("on"+type,f)}})();
// 在页面加载时播放初始动画。
window.addEventListener('load', function() {
window.setTimeout(function() {
$body.classList.remove('is-preload');
}, 100);
});
// Slideshow Background.
if (window.addEventListener) { window.addEventListener("load",sdqimgbg, false);}
else if (window.attachEvent) {window.attachEvent("onload",sdqimgbg); }
else{ window.onload =sdqimgbg; }
function sdqimgbg(){
(function() {
// Settings.
var settings = {
// Images (in the format of 'url': 'alignment').
images: {
'': 'center',
'': 'center',
'': 'center',
'': 'center'
},
// Delay.
delay: 6000
};
// Vars.
var pos = 0, lastPos = 0,
$wrapper, $bgs = [], $bg,
k, v;
var $sidebar = document.querySelector('#sidebar-nav');
var $main = document.querySelector('.main');
// Create BG wrapper, BGs.
$wrapper = document.createElement('div');
$wrapper.id = 'bg';
$sidebar.appendChild($wrapper);
//$main.appendChild($wrapper);
for (k in settings.images) {
// Create BG.
$bg = document.createElement('div');
$bg.style.backgroundImage = 'url("' + k + '")';
$bg.style.backgroundPosition = settings.images[k];
$wrapper.appendChild($bg);
// Add it to array.
$bgs.push($bg);
}
// Main loop.
$bgs[pos].classList.add('visible');
$bgs[pos].classList.add('top');
// Bail if we only have a single BG or the client doesn't support transitions.
if ($bgs.length == 1
|| !canUse('transition'))
return;
window.setInterval(function() {
lastPos = pos;
pos++;
// Wrap to beginning if necessary.
if (pos >= $bgs.length)
pos = 0;
// Swap top images.
$bgs[lastPos].classList.remove('top');
$bgs[pos].classList.add('visible');
$bgs[pos].classList.add('top');
}, settings.delay);
})(); // end
}
})();
</script>
<style>
body {
background-color: #000;
}
body.is-preload *, body.is-preload *:before, body.is-preload *:after {
-moz-animation: none !important;
-webkit-animation: none !important;
-ms-animation: none !important;
animation: none !important;
-moz-transition: none !important;
-webkit-transition: none !important;
-ms-transition: none !important;
transition: none !important;
}
/* BG */
#bg {
-moz-transition: opacity 2s ease-in-out;
-webkit-transition: opacity 2s ease-in-out;
-ms-transition: opacity 2s ease-in-out;
transition: opacity 2s ease-in-out;
height: 100%;
left: 0;
opacity: 0.2;
position: fixed;
top: 0;
width: 100%;
z-index: -1;
}
#bg div {
-moz-transition: opacity 3s ease, visibility 3s;
-webkit-transition: opacity 3s ease, visibility 3s;
-ms-transition: opacity 3s ease, visibility 3s;
transition: opacity 3s ease, visibility 3s;
background-size: cover;
height: 100%;
left: 0;
opacity: 0;
position: absolute;
top: 0;
visibility: hidden;
width: 150%;
}
#bg div.visible {
-moz-animation: bg 45s linear infinite;
-webkit-animation: bg 45s linear infinite;
-ms-animation: bg 45s linear infinite;
animation: bg 45s linear infinite;
opacity: 1;
visibility: visible;
z-index: 1;
}
#bg div.visible.top {
z-index: 2;
}
@media screen and (max-width: 1280px) {
#bg div.visible {
-moz-animation: bg 29.25s linear infinite;
-webkit-animation: bg 29.25s linear infinite;
-ms-animation: bg 29.25s linear infinite;
animation: bg 29.25s linear infinite;
}
}
@media screen and (max-width: 736px) {
#bg div.visible {
-moz-animation: bg 18s linear infinite;
-webkit-animation: bg 18s linear infinite;
-ms-animation: bg 18s linear infinite;
animation: bg 18s linear infinite;
}
}
#bg div:only-child {
-moz-animation-direction: alternate !important;
-webkit-animation-direction: alternate !important;
-ms-animation-direction: alternate !important;
animation-direction: alternate !important;
}
body.is-preload #bg {
opacity: 0;
}
@-moz-keyframes bg {
0% {
-moz-transform: translateX(0);
-webkit-transform: translateX(0);
-ms-transform: translateX(0);
transform: translateX(0);
}
100% {
-moz-transform: translateX(-25%);
-webkit-transform: translateX(-25%);
-ms-transform: translateX(-25%);
transform: translateX(-25%);
}
}
@-webkit-keyframes bg {
0% {
-moz-transform: translateX(0);
-webkit-transform: translateX(0);
-ms-transform: translateX(0);
transform: translateX(0);
}
100% {
-moz-transform: translateX(-25%);
-webkit-transform: translateX(-25%);
-ms-transform: translateX(-25%);
transform: translateX(-25%);
}
}
@-ms-keyframes bg {
0% {
-moz-transform: translateX(0);
-webkit-transform: translateX(0);
-ms-transform: translateX(0);
transform: translateX(0);
}
100% {
-moz-transform: translateX(-25%);
-webkit-transform: translateX(-25%);
-ms-transform: translateX(-25%);
transform: translateX(-25%);
}
}
@keyframes bg {
0% {
-moz-transform: translateX(0);
-webkit-transform: translateX(0);
-ms-transform: translateX(0);
transform: translateX(0);
}
100% {
-moz-transform: translateX(-25%);
-webkit-transform: translateX(-25%);
-ms-transform: translateX(-25%);
transform: translateX(-25%);
}
}
</style>
<div class="main">
<div class="main-content">
<style>
#sdqPost:hover{
background-color: rgba(255, 255, 255, 0.5)!important;
}
</style>
<div class="sdq">
<div class="sdq-post" id="sdqPost">
<div class="sdq-title">
<h1>C语 概述(程序结构)</h1>
</div>
<div id="post" class="sdq-post-Statistics">
<a>2019年11月19日</a>
<a class="post-count">99 字</a>
<a class=" -link" href="/categories/C%E8%AF%AD/">C语</a>
</div>
<div id="modal" style="display:none">
<aside id="article-toc" class="fixed-toc">
<div id="article-toc-inner">
<strong class="sidebar-title">目录</strong>
<ol class="toc"><li class="toc-item toc-level-1"><a class="toc-link" href="#%E6%80%BB%E4%BD%93%E7%BB%93%E6%9E%84"><span class="toc-text">总体结构</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E7%89%B9%E7%82%B9"><span class="toc-text">特点</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#%E5%87%BD%E6%95%B0%E7%9A%84%E4%B8%80%E8%88%AC%E7%BB%93%E6%9E%84"><span class="toc-text">函数的一般结构</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E8%AF%AD%E6%B3%95%E7%AC%A6%E5%8F%B7%E7%BA%A6%E5%AE%9A"><span class="toc-text">语法符号约定</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%87%BD%E6%95%B0%E8%AF%B4%E6%98%8E"><span class="toc-text">函数说明</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E5%87%BD%E6%95%B0%E4%BD%93"><span class="toc-text">函数体</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#%E8%AF%B4%E6%98%8E%E8%AF%AD%E5%8F%A5%E9%83%A8%E5%88%86"><span class="toc-text">说明语句部分</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%89%A7%E8%A1%8C%E8%AF%AD%E5%8F%A5%E9%83%A8%E5%88%86"><span class="toc-text">执行语句部分</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#%E6%BA%90%E7%A8%8B%E5%BA%8F%E4%B9%A6%E5%86%99%E6%A0%BC%E5%BC%8F"><span class="toc-text">源程序书写格式</span></a></li></ol></li></ol></li></ol></li><li class="toc-item toc-level-1"><a class="toc-link" href="#C%E8%AF%AD%E8%A8%80%E7%9A%84%E7%BC%96%E8%AF%91%E8%BF%87%E7%A8%8B"><span class="toc-text">C语言的编译过程:</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#C%E8%AF%AD%E8%A8%80%E7%9A%84%E5%85%B3%E9%94%AE%E5%AD%97"><span class="toc-text">C语言的关键字</span></a></li><li class="toc-item toc-level-1"><a class="toc-link" href="#C%E8%AF%AD%E8%A8%80%E4%B8%AD%E6%95%B0%E6%8D%AE%E5%85%83%E7%B4%A0%E6%98%AF%E5%9F%BA%E6%9C%AC%E5%8D%95%E4%BD%8D-%E6%95%B0%E6%8D%AE%E9%A1%B9%E6%98%AF%E6%9C%80%E5%B0%8F%E5%8D%95%E4%BD%8D%E4%B8%8D%E5%8F%AF%E5%88%86%E5%89%B2"><span class="toc-text">C语言中数据元素是基本单位, 数据项是最小单位不可分割</span></a><ol class="toc-child"><li class="toc-item toc-level-2"><a class="toc-link" href="#C%E8%AF%AD%E8%A8%80%E4%B8%AD-%E7%AE%97%E6%B3%95%E7%9A%84%E5%A4%8D%E6%9D%82%E6%80%A7"><span class="toc-text">C语言中 算法的复杂性</span></a><ol class="toc-child"><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%97%B6%E9%97%B4%E6%95%88%E7%8E%87%E5%BA%A6%E9%87%8F%E6%98%AF-%E6%97%B6%E9%97%B4%E5%A4%8D%E6%9D%82%E6%80%A7"><span class="toc-text">时间效率度量是 时间复杂性</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E7%AE%97%E6%B3%95%E5%A4%8D%E6%9D%82%E6%80%A7%E9%87%8F%E5%BA%A6%E6%98%AF-%E7%A9%BA%E9%97%B4%E5%A4%8D%E6%9D%82%E6%80%A7"><span class="toc-text">算法复杂性量度是 空间复杂性</span></a></li><li class="toc-item toc-level-3"><a class="toc-link" href="#%E6%97%B6%E7%A9%BA%E5%A4%8D%E6%9D%82%E6%80%A7%E6%9C%89%E6%9C%80%E5%A5%BD%E6%83%85%E5%86%B5%E5%92%8C%E6%9C%80%E5%9D%8F%E6%83%85%E5%86%B5-%E4%B8%80%E8%88%AC%E6%8C%87%E7%9A%84%E6%98%AF%E5%B9%B3%E5%9D%87%E5%A4%8D%E6%9D%82%E6%80%A7"><span class="toc-text">时空复杂性有最好情况和最坏情况, 一般指的是平均复杂性</span></a></li></ol></li></ol></li></ol>
</div>
</aside>
</div>
<a href="#modal" class="second">
<div class="i">
<i style="font-size:20px" class="sdq3 sdqfasong">
<span style="font-size:0px">
</i>
</div>
</a>
<script>
$(".second .i").mouseover(function(){
$(".second .i span").css("font-size","18px");
});
$(".second .i").mouseleave(function(){
$(".second .i span").css("font-size","0px");
});
</script>
<div>
<article>
<p><strong>C语学习笔记</strong></p>
<a id="more"></a>
<h1 id="总体结构"><a href="#总体结构" class="headerlink" title="总体结构"></a>总体结构</h1><ul>
<li>一个完整的C语言程序是由一个且<font color="#FA8072">只能有一个 main() 函数 (又称主要函数)</font> 和 若干个其他函数结合而成, 或仅由一个 main() 构成</li>
</ul>
<h1 id="特点"><a href="#特点" class="headerlink" title="特点"></a>特点</h1><ul>
<li><p><font color="#FA8072">函数</font>是C语言的<font color="#FA8072">基本单位</font>, 所有的C语言程序都是由一个 mian() 函数或一个 mian() 函数与多个其它函数构成的 mian() 函数的作用相当于其他高级语言的<font color="#FA8072">主程序</font> 其他函数的作用相当于子程序</p>
</li>
<li><p><font color="#FA8072">函数</font>一般包括数据的定义部分和执行部分 <font color="#FA8072">数据定义部分 (也称声明部分)</font>用于定义程序用到的所有<font color="#FA8072">变量的名字和变量类型</font>, 并可以对变量指定初值 执行部分用于完成程序所规定的各项操作</p>
</li>
<li><p>C语言程序总是从 mian() 函数开始执行 一个C语言开始执行 一个C语言程序总是从 mian() 函数开始执行, 而不论其在程序中位置如何 主函数执行完毕, 亦即程序执行完毕 习惯上将主函数 mian() 放在最前头</p>
</li>
</ul>
<h1 id="函数的一般结构"><a href="#函数的一般结构" class="headerlink" title="函数的一般结构"></a>函数的一般结构</h1><ul>
<li>任何函数(包括主函数 main() )都是由函数说明和函数体两部分组成</li>
</ul>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><code class="hljs C">[函数类型] 函数名 (函数参数表) <span class="hljs-comment">/* 函数说明部分 */</span><br>{<br> 说明语句部分; <span class="hljs-comment">/* 函数体部分 */</span><br> 执行语句部分; <span class="hljs-comment">/* 函数体部分 */</span><br>}<br></code></pre></td></tr></table></figure>
<h3 id="语法符号约定"><a href="#语法符号约定" class="headerlink" title="语法符号约定"></a>语法符号约定</h3><ul>
<li>[…] 方括号表示可选 (既可以指定也可以缺省)</li>
<li>… 省略号表示前面的项可以重复</li>
<li>| 表示是两侧的项必选其一 </li>
</ul>
<h3 id="函数说明"><a href="#函数说明" class="headerlink" title="函数说明"></a>函数说明</h3><ul>
<li>由函数类型(可缺省) 函数名和函数参数表 三部分组成</li>
</ul>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs C">数据类型 参数<span class="hljs-number">1</span> [, 数据类型 参数<span class="hljs-number">2</span> .]<br></code></pre></td></tr></table></figure>
<h3 id="函数体"><a href="#函数体" class="headerlink" title="函数体"></a>函数体</h3><ul>
<li>大括号(必须配对使用)内的说明语句部分和执行【语句部分为函数体</li>
</ul>
<h4 id="说明语句部分"><a href="#说明语句部分" class="headerlink" title="说明语句部分"></a>说明语句部分</h4><ul>
<li>说明语句部分由变量定义, 自定义类型定义, 自定义函数说明, 外部变量说明等部分组成, 其中变量定义是主要的</li>
</ul>
<h4 id="执行语句部分"><a href="#执行语句部分" class="headerlink" title="执行语句部分"></a>执行语句部分</h4><ul>
<li>执行语句部分由若干条执行语句构成</li>
</ul>
<h4 id="源程序书写格式"><a href="#源程序书写格式" class="headerlink" title="源程序书写格式"></a>源程序书写格式</h4><ul>
<li><p>所有语句都必须以分号 “;” 结束, 函数的最后一个语句也不例外</p>
</li>
<li><p>程序行的书写格式自由, 即允许一条内写几条语句, 也允许一条语句分成几行写</p>
</li>
<li><p>/* 要注释的代码 */ 必须按照注释格式注释</p>
</li>
<li><p>注释可以单站一行, 也可以跟在语句的后面, 如果一行写不下, 可另起一行继续写</p>
</li>
<li><p>注释中 /* 可以是任意中文 符合 */ 在非中文 环境显示乱码 但是不影响程序的执行</p>
</li>
</ul>
<h1 id="C语言的编译过程"><a href="#C语言的编译过程" class="headerlink" title="C语言的编译过程:"></a>C语言的编译过程:</h1><br>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs C">编辑 -> 预处理 -> 编译 -> 汇编 -> 链接 -> 运行<br></code></pre></td></tr></table></figure>
<br>
<h1 id="C语言的关键字"><a href="#C语言的关键字" class="headerlink" title="C语言的关键字"></a>C语言的关键字</h1><br>
<figure class="highlight c"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br></pre></td><td class="code"><pre><code class="hljs C"><span class="hljs-keyword">auto</span>: 声明自动变量<br><br><span class="hljs-keyword">break</span>: 跳出当前循环<br><br><span class="hljs-keyword">case</span>: 开关语句分支<br><br><span class="hljs-type">char</span>: 声明字符型变量或函数返回值类型<br><br><span class="hljs-keyword">const</span>: 声明只读变量<br><br><span class="hljs-keyword">continue</span>: 结束当前循环, 开始下一轮循环<br><br><span class="hljs-keyword">default</span>: 开关语句中的 <span class="hljs-string">"默认"</span> 分支<br><br><span class="hljs-keyword">do</span>: 循环语句的循环体<br><br><span class="hljs-type">double</span>: 声明双精度浮点型变量或函数返回值类型<br><br><span class="hljs-keyword">else</span>: 条件语句否定分支 (与<span class="hljs-keyword">if</span>连用 )<br><br><span class="hljs-class"><span class="hljs-keyword">enum</span>:</span> 声明枚举类型<br><br><span class="hljs-keyword">extern</span>: 声明变量或函数是在其它文件或本文件的其他位置定义<br><br><span class="hljs-type">float</span>: 声明浮点型变量或函数返回值类型<br><br><span class="hljs-keyword">for</span>: 一种循环语句<br><br><span class="hljs-keyword">goto</span>: 无条件跳转语句<br><br><span class="hljs-keyword">if</span>: 条件语句<br><br><span class="hljs-type">int</span>: 声明整型变量或函数<br><br><span class="hljs-type">long</span>: 声明长整型变量或函数返回值类型<br><br><span class="hljs-keyword">register</span>: 声明寄存器变量<br><br><span class="hljs-keyword">return</span>: 子程序返回语句 (可以带参数, 也可不带参数 )<br><br><span class="hljs-type">short</span>: 声明短整型变量或函数<br><br><span class="hljs-type">signed</span>: 声明有符号类型变量或函数<br><br><span class="hljs-keyword">sizeof</span>: 计算数据类型或变量长度 (即所占字节数 )<br><br><span class="hljs-keyword">static</span>: 声明静态变量<br><br><span class="hljs-class"><span class="hljs-keyword">struct</span>:</span> 声明结构体类型<br><br><span class="hljs-keyword">switch</span>: 用于开关语句<br><br><span class="hljs-keyword">typedef</span>: 用以给数据类型取别名<br><br><span class="hljs-type">unsigned</span>: 声明无符号类型变量或函数<br><br><span class="hljs-class"><span class="hljs-keyword">union</span>:</span> 声明共用体类型<br><br><span class="hljs-type">void</span>: 声明函数无返回值或无参数, 声明无类型指针<br><br><span class="hljs-keyword">volatile</span>: 说明变量在程序执行中可被隐含地改变<br><br><span class="hljs-keyword">while</span>: 循环语句的循环条件<br></code></pre></td></tr></table></figure>
<br>
<h1 id="C语言中数据元素是基本单位-数据项是最小单位不可分割"><a href="#C语言中数据元素是基本单位-数据项是最小单位不可分割" class="headerlink" title="C语言中数据元素是基本单位, 数据项是最小单位不可分割"></a>C语言中数据元素是基本单位, 数据项是最小单位不可分割</h1><h2 id="C语言中-算法的复杂性"><a href="#C语言中-算法的复杂性" class="headerlink" title="C语言中 算法的复杂性"></a>C语言中 算法的复杂性</h2><ul>
<li><h3 id="时间效率度量是-时间复杂性"><a href="#时间效率度量是-时间复杂性" class="headerlink" title="时间效率度量是 时间复杂性"></a>时间效率度量是 时间复杂性</h3><ul>
<li>时间复杂性是指运行时间</li>
</ul>
</li>
</ul>
<ul>