From cb0cc3a74634760aeb64f9778266d8ed4699e836 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=89=BF=E4=BF=9E=E5=98=89?= Date: Sun, 11 Oct 2015 09:33:19 +0800 Subject: [PATCH] =?UTF-8?q?0.5=20=E5=AE=9E=E7=8E=B0=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E8=BE=93=E5=85=A5=E5=B9=B6=E6=B7=BB=E5=8A=A0=E8=A1=8C=E5=8F=B7?= =?UTF-8?q?=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitattributes | 63 +++++++++++++++ 0.5/0.5.sln | 28 +++++++ 0.5/0.5/0.5.vcxproj | 154 ++++++++++++++++++++++++++++++++++++ 0.5/0.5/0.5.vcxproj.filters | 22 ++++++ 0.5/0.5/main.c | 64 +++++++++++++++ 0.8/0.8.sln | 28 +++++++ 0.8/0.8/0.8.vcxproj | 153 +++++++++++++++++++++++++++++++++++ 0.8/0.8/0.8.vcxproj.filters | 17 ++++ 8 files changed, 529 insertions(+) create mode 100644 .gitattributes create mode 100644 0.5/0.5.sln create mode 100644 0.5/0.5/0.5.vcxproj create mode 100644 0.5/0.5/0.5.vcxproj.filters create mode 100644 0.5/0.5/main.c create mode 100644 0.8/0.8.sln create mode 100644 0.8/0.8/0.8.vcxproj create mode 100644 0.8/0.8/0.8.vcxproj.filters diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..1ff0c42 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,63 @@ +############################################################################### +# Set default behavior to automatically normalize line endings. +############################################################################### +* text=auto + +############################################################################### +# Set default behavior for command prompt diff. +# +# This is need for earlier builds of msysgit that does not have it on by +# default for csharp files. +# Note: This is only used by command line +############################################################################### +#*.cs diff=csharp + +############################################################################### +# Set the merge driver for project and solution files +# +# Merging from the command prompt will add diff markers to the files if there +# are conflicts (Merging from VS is not affected by the settings below, in VS +# the diff markers are never inserted). Diff markers may cause the following +# file extensions to fail to load in VS. An alternative would be to treat +# these files as binary and thus will always conflict and require user +# intervention with every merge. To do so, just uncomment the entries below +############################################################################### +#*.sln merge=binary +#*.csproj merge=binary +#*.vbproj merge=binary +#*.vcxproj merge=binary +#*.vcproj merge=binary +#*.dbproj merge=binary +#*.fsproj merge=binary +#*.lsproj merge=binary +#*.wixproj merge=binary +#*.modelproj merge=binary +#*.sqlproj merge=binary +#*.wwaproj merge=binary + +############################################################################### +# behavior for image files +# +# image files are treated as binary by default. +############################################################################### +#*.jpg binary +#*.png binary +#*.gif binary + +############################################################################### +# diff behavior for common document formats +# +# Convert binary document formats to text before diffing them. This feature +# is only available from the command line. Turn it on by uncommenting the +# entries below. +############################################################################### +#*.doc diff=astextplain +#*.DOC diff=astextplain +#*.docx diff=astextplain +#*.DOCX diff=astextplain +#*.dot diff=astextplain +#*.DOT diff=astextplain +#*.pdf diff=astextplain +#*.PDF diff=astextplain +#*.rtf diff=astextplain +#*.RTF diff=astextplain diff --git a/0.5/0.5.sln b/0.5/0.5.sln new file mode 100644 index 0000000..8426c19 --- /dev/null +++ b/0.5/0.5.sln @@ -0,0 +1,28 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.23107.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "0.5", "0.5\0.5.vcxproj", "{B58A8FDA-7CB9-4C3A-8CBB-780C23FF28CA}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B58A8FDA-7CB9-4C3A-8CBB-780C23FF28CA}.Debug|x64.ActiveCfg = Debug|x64 + {B58A8FDA-7CB9-4C3A-8CBB-780C23FF28CA}.Debug|x64.Build.0 = Debug|x64 + {B58A8FDA-7CB9-4C3A-8CBB-780C23FF28CA}.Debug|x86.ActiveCfg = Debug|Win32 + {B58A8FDA-7CB9-4C3A-8CBB-780C23FF28CA}.Debug|x86.Build.0 = Debug|Win32 + {B58A8FDA-7CB9-4C3A-8CBB-780C23FF28CA}.Release|x64.ActiveCfg = Release|x64 + {B58A8FDA-7CB9-4C3A-8CBB-780C23FF28CA}.Release|x64.Build.0 = Release|x64 + {B58A8FDA-7CB9-4C3A-8CBB-780C23FF28CA}.Release|x86.ActiveCfg = Release|Win32 + {B58A8FDA-7CB9-4C3A-8CBB-780C23FF28CA}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/0.5/0.5/0.5.vcxproj b/0.5/0.5/0.5.vcxproj new file mode 100644 index 0000000..1cd3f8e --- /dev/null +++ b/0.5/0.5/0.5.vcxproj @@ -0,0 +1,154 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {B58A8FDA-7CB9-4C3A-8CBB-780C23FF28CA} + Win32Proj + My05 + 8.1 + + + + Application + true + v140 + Unicode + + + Application + false + v140 + true + Unicode + + + Application + true + v140 + Unicode + + + Application + false + v140 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + true + + + false + + + false + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + + + Level3 + Disabled + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/0.5/0.5/0.5.vcxproj.filters b/0.5/0.5/0.5.vcxproj.filters new file mode 100644 index 0000000..6cedf04 --- /dev/null +++ b/0.5/0.5/0.5.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + 源文件 + + + \ No newline at end of file diff --git a/0.5/0.5/main.c b/0.5/0.5/main.c new file mode 100644 index 0000000..7c97b86 --- /dev/null +++ b/0.5/0.5/main.c @@ -0,0 +1,64 @@ +#include +#include +#include +#define MAXLENGTH 200 +typedef struct Line +{ + int lineNumber; + char lineContent[200]; + struct Line * next; +}Line; +main() +{ + FILE *fp; + errno_t err; + int i=0, j=0, k; + char str[MAXLENGTH]; + Line * lp = NULL, *p = NULL; + char filename[] = "D:\\test.c"; + // Open for read (will fail if file "D:\\test.c" does not exist). + err = fopen_s(&fp, filename, "r"); + if (err == 0) + { + printf("The file 'test.c' was opened.\n"); + } + else + { + printf("The file 'test.c' was not opened.\n"); + } + lp = (Line *)malloc(sizeof(Line)); + p = lp; + // + while (!feof(fp)) + { + i++; + fgets(str, MAXLENGTH, fp); + strcpy_s(p->lineContent, MAXLENGTH,str); + p->lineNumber = i; + p->next = (Line *)malloc(sizeof(Line)); + p = p->next; + } + free(p); + p = lp; + printf("Please comform the content of the file.\n"); + for (j = 0; j < i; j++) + { + printf("%d %s", p->lineNumber, p->lineContent); + p = p->next; + } + printf("\n"); + // Close fp if it is not NULL. + if (fp) + { + err = fclose(fp); + if (err == 0) + { + printf("The file 'test.c' was closed.\n"); + } + else + { + printf("The file 'test.c' was not closed.\n"); + } + } + getchar(); +} \ No newline at end of file diff --git a/0.8/0.8.sln b/0.8/0.8.sln new file mode 100644 index 0000000..a5d71a5 --- /dev/null +++ b/0.8/0.8.sln @@ -0,0 +1,28 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.23107.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "0.8", "0.8\0.8.vcxproj", "{1E06E041-7B5A-4C57-8C29-D098AD84A3A1}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1E06E041-7B5A-4C57-8C29-D098AD84A3A1}.Debug|x64.ActiveCfg = Debug|x64 + {1E06E041-7B5A-4C57-8C29-D098AD84A3A1}.Debug|x64.Build.0 = Debug|x64 + {1E06E041-7B5A-4C57-8C29-D098AD84A3A1}.Debug|x86.ActiveCfg = Debug|Win32 + {1E06E041-7B5A-4C57-8C29-D098AD84A3A1}.Debug|x86.Build.0 = Debug|Win32 + {1E06E041-7B5A-4C57-8C29-D098AD84A3A1}.Release|x64.ActiveCfg = Release|x64 + {1E06E041-7B5A-4C57-8C29-D098AD84A3A1}.Release|x64.Build.0 = Release|x64 + {1E06E041-7B5A-4C57-8C29-D098AD84A3A1}.Release|x86.ActiveCfg = Release|Win32 + {1E06E041-7B5A-4C57-8C29-D098AD84A3A1}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/0.8/0.8/0.8.vcxproj b/0.8/0.8/0.8.vcxproj new file mode 100644 index 0000000..f53c04e --- /dev/null +++ b/0.8/0.8/0.8.vcxproj @@ -0,0 +1,153 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + {1E06E041-7B5A-4C57-8C29-D098AD84A3A1} + Win32Proj + My08 + 8.1 + + + + Application + true + v140 + Unicode + + + Application + false + v140 + true + Unicode + + + Application + true + v140 + Unicode + + + Application + false + v140 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + true + + + false + + + false + + + + + + Level3 + Disabled + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + + + Level3 + Disabled + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + + + MaxSpeed + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + + + MaxSpeed + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + \ No newline at end of file diff --git a/0.8/0.8/0.8.vcxproj.filters b/0.8/0.8/0.8.vcxproj.filters new file mode 100644 index 0000000..03c8628 --- /dev/null +++ b/0.8/0.8/0.8.vcxproj.filters @@ -0,0 +1,17 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + \ No newline at end of file