-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
23bbf01
commit 8e15c76
Showing
200 changed files
with
9,502 additions
and
705 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"CurrentProjectSetting": "x64-Debug" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"OutputFoldersPerTargetSystem": { | ||
"\u672C\u5730\u8BA1\u7B97\u673A": [ | ||
"out\\build\\x64-Debug", | ||
"out\\install\\x64-Debug" | ||
] | ||
}, | ||
"ExpandedNodes": [ | ||
"", | ||
"\\13" | ||
], | ||
"PreviewInSolutionExplorer": false | ||
} |
Binary file not shown.
Binary file added
BIN
+5.3 KB
.vs/learn_c_primer.github.io/FileContentIndex/1d4ec389-4f90-422f-a904-ac62d9602018.vsidx
Binary file not shown.
Binary file added
BIN
+912 KB
.vs/learn_c_primer.github.io/FileContentIndex/66f8a618-d83e-4371-86a0-007c40188683.vsidx
Binary file not shown.
Binary file added
BIN
+6.3 KB
.vs/learn_c_primer.github.io/FileContentIndex/74bce83d-0676-42fa-a97d-0e1d78579cc7.vsidx
Binary file not shown.
Binary file added
BIN
+13.6 KB
.vs/learn_c_primer.github.io/FileContentIndex/95d19555-cf9a-4dc9-a3be-a783ebd22a83.vsidx
Binary file not shown.
Binary file added
BIN
+5.28 KB
.vs/learn_c_primer.github.io/FileContentIndex/c98827f8-a0dc-4802-a779-5e149176a2c4.vsidx
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file added
BIN
+2.94 MB
.vs/learn_c_primer.github.io/v16/ipch/AutoPCH/553a75325f793f50/13.2.ipch
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
{ | ||
"Version": 1, | ||
"WorkspaceRootPath": "C:\\Users\\TGSpock\\Documents\\GitHub\\learn_c_primer.github.io\\", | ||
"Documents": [ | ||
{ | ||
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\TGSpock\\Documents\\GitHub\\learn_c_primer.github.io\\CMakeLists.txt||{8B382828-6202-11D1-8870-0000F87579D2}", | ||
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:CMakeLists.txt||{8B382828-6202-11D1-8870-0000F87579D2}" | ||
}, | ||
{ | ||
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\TGSpock\\Documents\\GitHub\\learn_c_primer.github.io\\13\\13.4.c||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", | ||
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:13\\13.4.c||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" | ||
}, | ||
{ | ||
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\TGSpock\\Documents\\GitHub\\learn_c_primer.github.io\\13\\13.3.c||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", | ||
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:13\\13.3.c||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" | ||
}, | ||
{ | ||
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\TGSpock\\Documents\\GitHub\\learn_c_primer.github.io\\13\\13.2.c||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", | ||
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:13\\13.2.c||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" | ||
}, | ||
{ | ||
"AbsoluteMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|C:\\Users\\TGSpock\\Documents\\GitHub\\learn_c_primer.github.io\\13\\13.1.c||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", | ||
"RelativeMoniker": "D:0:0:{A2FE74E1-B743-11D0-AE1A-00A0C90FFFC3}|\u003CMiscFiles\u003E|solutionrelative:13\\13.1.c||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" | ||
} | ||
], | ||
"DocumentGroupContainers": [ | ||
{ | ||
"Orientation": 0, | ||
"VerticalTabListWidth": 256, | ||
"DocumentGroups": [ | ||
{ | ||
"DockedWidth": 200, | ||
"SelectedChildIndex": 0, | ||
"Children": [ | ||
{ | ||
"$type": "Document", | ||
"DocumentIndex": 0, | ||
"Title": "CMakeLists.txt", | ||
"DocumentMoniker": "C:\\Users\\TGSpock\\Documents\\GitHub\\learn_c_primer.github.io\\CMakeLists.txt", | ||
"RelativeDocumentMoniker": "CMakeLists.txt", | ||
"ToolTip": "C:\\Users\\TGSpock\\Documents\\GitHub\\learn_c_primer.github.io\\CMakeLists.txt", | ||
"RelativeToolTip": "CMakeLists.txt", | ||
"ViewState": "AQIAAAAAAAAAAAAAAAAQwAcAAAAOAAAA", | ||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.003109|", | ||
"WhenOpened": "2024-03-14T10:55:32.027Z", | ||
"IsPinned": true, | ||
"EditorCaption": "" | ||
}, | ||
{ | ||
"$type": "Document", | ||
"DocumentIndex": 1, | ||
"Title": "13.4.c", | ||
"DocumentMoniker": "C:\\Users\\TGSpock\\Documents\\GitHub\\learn_c_primer.github.io\\13\\13.4.c", | ||
"RelativeDocumentMoniker": "13\\13.4.c", | ||
"ToolTip": "C:\\Users\\TGSpock\\Documents\\GitHub\\learn_c_primer.github.io\\13\\13.4.c", | ||
"RelativeToolTip": "13\\13.4.c", | ||
"ViewState": "AQIAAAYAAAAAAAAAAAAAABgAAAAeAAAA", | ||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000423|", | ||
"WhenOpened": "2024-03-17T15:32:19.207Z", | ||
"EditorCaption": "" | ||
}, | ||
{ | ||
"$type": "Document", | ||
"DocumentIndex": 2, | ||
"Title": "13.3.c", | ||
"DocumentMoniker": "C:\\Users\\TGSpock\\Documents\\GitHub\\learn_c_primer.github.io\\13\\13.3.c", | ||
"RelativeDocumentMoniker": "13\\13.3.c", | ||
"ToolTip": "C:\\Users\\TGSpock\\Documents\\GitHub\\learn_c_primer.github.io\\13\\13.3.c", | ||
"RelativeToolTip": "13\\13.3.c", | ||
"ViewState": "AQIAAAAAAAAAAAAAAAAAACkAAAACAAAA", | ||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000423|", | ||
"WhenOpened": "2024-03-15T06:08:22.529Z", | ||
"EditorCaption": "" | ||
}, | ||
{ | ||
"$type": "Document", | ||
"DocumentIndex": 4, | ||
"Title": "13.1.c", | ||
"DocumentMoniker": "C:\\Users\\TGSpock\\Documents\\GitHub\\learn_c_primer.github.io\\13\\13.1.c", | ||
"RelativeDocumentMoniker": "13\\13.1.c", | ||
"ToolTip": "C:\\Users\\TGSpock\\Documents\\GitHub\\learn_c_primer.github.io\\13\\13.1.c", | ||
"RelativeToolTip": "13\\13.1.c", | ||
"ViewState": "AQIAAAYAAAAAAAAAAAAAABEAAAAmAAAA", | ||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000423|", | ||
"WhenOpened": "2024-03-15T05:54:29.157Z", | ||
"EditorCaption": "" | ||
}, | ||
{ | ||
"$type": "Document", | ||
"DocumentIndex": 3, | ||
"Title": "13.2.c", | ||
"DocumentMoniker": "C:\\Users\\TGSpock\\Documents\\GitHub\\learn_c_primer.github.io\\13\\13.2.c", | ||
"RelativeDocumentMoniker": "13\\13.2.c", | ||
"ToolTip": "C:\\Users\\TGSpock\\Documents\\GitHub\\learn_c_primer.github.io\\13\\13.2.c", | ||
"RelativeToolTip": "13\\13.2.c", | ||
"ViewState": "AQIAACQAAAAAAAAAAAAAABwAAAAaAAAA", | ||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000423|", | ||
"WhenOpened": "2024-03-14T13:41:17.799Z", | ||
"EditorCaption": "" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
Binary file not shown.
Binary file added
BIN
+4.5 MB
.vs/learn_c_primer.github.io/v17/ipch/AutoPCH/44e9cb325684b8f2/13.4.ipch
Binary file not shown.
Binary file added
BIN
+3.19 MB
.vs/learn_c_primer.github.io/v17/ipch/AutoPCH/4c9e14325a9bf72f/13.3.ipch
Binary file not shown.
Binary file added
BIN
+2.44 MB
.vs/learn_c_primer.github.io/v17/ipch/AutoPCH/536562518f38e07c/11.6.ipch
Binary file not shown.
Binary file added
BIN
+3.19 MB
.vs/learn_c_primer.github.io/v17/ipch/AutoPCH/553a75325f793f50/13.2.ipch
Binary file not shown.
Binary file added
BIN
+2.94 MB
.vs/learn_c_primer.github.io/v17/ipch/AutoPCH/5e35863264a69405/13.1.ipch
Binary file not shown.
Binary file added
BIN
+3.44 MB
.vs/learn_c_primer.github.io/v17/ipch/AutoPCH/770258b7bba177d9/11.25.ipch
Binary file not shown.
Binary file added
BIN
+3.44 MB
.vs/learn_c_primer.github.io/v17/ipch/AutoPCH/9f4643a86c9665fa/11.42.ipch
Binary file not shown.
Binary file added
BIN
+3.38 MB
.vs/learn_c_primer.github.io/v17/ipch/AutoPCH/b29d50f79aeadeeb/13.3.ipch
Binary file not shown.
Binary file added
BIN
+3.38 MB
.vs/learn_c_primer.github.io/v17/ipch/AutoPCH/ba5f31f79f0da9cc/13.2.ipch
Binary file not shown.
Binary file added
BIN
+3.13 MB
.vs/learn_c_primer.github.io/v17/ipch/AutoPCH/c2ed82f7a3de9961/13.1.ipch
Binary file not shown.
Binary file added
BIN
+2.38 MB
.vs/learn_c_primer.github.io/v17/ipch/AutoPCH/ee4a7ff7bc721bf6/13.4.ipch
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"version": "0.2.1", | ||
"tasks": [ | ||
{ | ||
"taskLabel": "\u4EFB\u52A1-learn_c_primer.github", | ||
"appliesTo": "/", | ||
"type": "launch" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
int main (int argc, char * argv[]) | ||
{ | ||
int ch; | ||
FILE * fp; | ||
unsigned long count =0; | ||
|
||
if (argc != 2) | ||
{ | ||
printf ("usage: %s filename\n", argv[0]); | ||
exit (EXIT_FAILURE); | ||
} | ||
else; | ||
|
||
if (!(fp = fopen(argv[1], "r"))) | ||
{ | ||
printf ("can't open %s\n", argv[1]); | ||
exit (EXIT_FAILURE); | ||
} | ||
else; | ||
|
||
while ((ch = getc(fp)) != EOF) | ||
{ | ||
putc (ch, stdout); | ||
count ++; | ||
} | ||
|
||
if (fclose(fp)) | ||
{ | ||
printf("error in closing file %s\n", argv[1]); | ||
} | ||
else; | ||
|
||
printf ("file %s has %lu characters\n", argv[1], count); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
#define LEN 40 | ||
|
||
int main (int argc, char * argv[]) | ||
{ | ||
FILE * in, * out; | ||
int ch; | ||
char name[LEN]; | ||
int count = 0; | ||
|
||
if (argc < 2) | ||
{ | ||
fprintf (stderr, "usage: %s filename\n", argv[0]); | ||
exit (EXIT_FAILURE); | ||
} | ||
else; | ||
|
||
if (!(in = fopen (argv[1], "r"))) | ||
{ | ||
fprintf (stderr, "i couldn't open the file \"%s\"\n", argv[1]); | ||
exit (EXIT_FAILURE); | ||
} | ||
else; | ||
|
||
strncpy (name, argv[1], LEN - 5); | ||
name[LEN - 5] = '\0'; | ||
strcat (name, ".red"); | ||
|
||
if (!(out = fopen (name, "w"))) | ||
{ | ||
fprintf (stderr, "can't create oupput file. \n"); | ||
exit (3); | ||
} | ||
else; | ||
|
||
while ((ch = getc(in)) != EOF) | ||
{ | ||
if (count ++ % 3 == 0) | ||
{ | ||
putc (ch, out); | ||
} | ||
else; | ||
} | ||
|
||
if (fclose(in) || fclose(out)) | ||
{ | ||
fprintf(stderr, "error in closing files. \n"); | ||
} | ||
else; | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <string.h> | ||
#define MAX 41 | ||
|
||
int main(void) | ||
{ | ||
FILE * fp; | ||
char word[MAX]; | ||
|
||
//fopen()第二个参数作用: | ||
//单独使用r时为只读, 单独使用w或a时为只写. | ||
//r+会把指针摆到开头写, w+会把文件清空写, a+会接着文件屁股写. | ||
//例如 源文件: 012345678 输入:910jq | ||
//r+输出: 910jq5678 w+输出: 910jq a+输出: 012345678910jq | ||
if(!(fp = fopen("wordy", "a+"))) | ||
{ | ||
fprintf(stdout, "Can't open \"wordy\" file. \n"); | ||
exit(EXIT_FAILURE); | ||
} | ||
else; | ||
|
||
puts("Enter words to add to the file; press the #"); | ||
puts("key at the beginning of a line to terminate."); | ||
|
||
while((fscanf(stdin, "%40s", word)) && (word[0] != '#')) | ||
{ | ||
fprintf(fp, "%s\n", word); | ||
} | ||
|
||
puts("File contents: "); | ||
rewind(fp); | ||
|
||
while(fscanf(fp, "%s", word) == 1) | ||
{ | ||
puts(word); | ||
} | ||
|
||
if (fclose(fp)) | ||
{ | ||
fprintf(stderr, "error closing file\n"); | ||
} | ||
else; | ||
|
||
return 0; | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#define CTRL_Z '\032' | ||
#define SLEN 81 | ||
int main(void) | ||
{ | ||
char file[SLEN]; | ||
char ch; | ||
FILE * fp; | ||
long count, last; | ||
|
||
fputs("Enter the name of file to be processed: \n", stdout); | ||
scanf("%80s", file); | ||
if(!(fp = fopen(file, "rb"))) | ||
{ | ||
printf("revers can't open %s\n", file); | ||
exit(EXIT_FAILURE); | ||
} | ||
|
||
fseek(fp, 0L, SEEK_END); | ||
last = ftell(fp); | ||
|
||
for (count = 1L; count <= last; count++) | ||
{ | ||
fseek(fp, -count, SEEK_END); | ||
ch = getc(fp); | ||
if (ch != CTRL_Z && ch != '\r') | ||
{ | ||
putchar(ch); | ||
} | ||
} | ||
|
||
putchar('\n'); | ||
fclose(fp); | ||
|
||
return 0; | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
So even Eddy came oven ready. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Send money |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"configurations": [ | ||
{ | ||
"name": "x64-Debug", | ||
"generator": "Ninja", | ||
"configurationType": "Debug", | ||
"inheritEnvironments": [ "msvc_x64_x64" ], | ||
"buildRoot": "${projectDir}\\out\\build\\${name}", | ||
"installRoot": "${projectDir}\\out\\install\\${name}", | ||
"cmakeCommandArgs": "", | ||
"buildCommandArgs": "", | ||
"ctestCommandArgs": "" | ||
} | ||
] | ||
} |
Oops, something went wrong.