Skip to content

Commit 929f545

Browse files
committed
Initial commit
0 parents  commit 929f545

14 files changed

+721
-0
lines changed

.editorconfig

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
root = true
2+
3+
[*.{inc,mac,asm,s}]
4+
5+
charset = utf-8
6+
7+
# Visual Studio generated .editorconfig file with C++ settings.
8+
9+
[*.{c,c++,cc,cpp,cppm,cxx,h,h++,hh,hpp,hxx,inl,ipp,ixx,tlh,tli}]
10+
11+
charset = utf-8-bom
12+
indent_style = spaces
13+
indent_size = 4
14+
tab_width= 4
15+
end_of_line = crlf
16+
insert_final_newline = true
17+
max_line_length = 120
18+
19+
# Visual C++ Code Style settings
20+
21+
cpp_generate_documentation_comments = xml
22+
23+
# Visual C++ Formatting settings
24+
25+
cpp_indent_braces = false
26+
cpp_indent_multi_line_relative_to = innermost_parenthesis
27+
cpp_indent_within_parentheses = align_to_parenthesis
28+
cpp_indent_preserve_within_parentheses = false
29+
cpp_indent_case_contents = true
30+
cpp_indent_case_labels = true
31+
cpp_indent_case_contents_when_block = false
32+
cpp_indent_lambda_braces_when_parameter = false
33+
cpp_indent_goto_labels = leftmost_column
34+
cpp_indent_preprocessor = leftmost_column
35+
cpp_indent_access_specifiers = false
36+
cpp_indent_namespace_contents = true
37+
cpp_indent_preserve_comments = true
38+
cpp_new_line_before_open_brace_namespace = new_line
39+
cpp_new_line_before_open_brace_type = new_line
40+
cpp_new_line_before_open_brace_function = new_line
41+
cpp_new_line_before_open_brace_block = new_line
42+
cpp_new_line_before_open_brace_lambda = new_line
43+
cpp_new_line_scope_braces_on_separate_lines = true
44+
cpp_new_line_close_brace_same_line_empty_type = true
45+
cpp_new_line_close_brace_same_line_empty_function = true
46+
cpp_new_line_before_catch = false
47+
cpp_new_line_before_else = false
48+
cpp_new_line_before_while_in_do_while = false
49+
cpp_space_before_function_open_parenthesis = remove
50+
cpp_space_within_parameter_list_parentheses = false
51+
cpp_space_between_empty_parameter_list_parentheses = false
52+
cpp_space_after_keywords_in_control_flow_statements = true
53+
cpp_space_within_control_flow_statement_parentheses = false
54+
cpp_space_before_lambda_open_parenthesis = false
55+
cpp_space_within_cast_parentheses = false
56+
cpp_space_after_cast_close_parenthesis = false
57+
cpp_space_within_expression_parentheses = false
58+
cpp_space_before_block_open_brace = true
59+
cpp_space_between_empty_braces = false
60+
cpp_space_before_initializer_list_open_brace = false
61+
cpp_space_within_initializer_list_braces = true
62+
cpp_space_preserve_in_initializer_list = true
63+
cpp_space_before_open_square_bracket = false
64+
cpp_space_within_square_brackets = false
65+
cpp_space_before_empty_square_brackets = false
66+
cpp_space_between_empty_square_brackets = false
67+
cpp_space_group_square_brackets = true
68+
cpp_space_within_lambda_brackets = false
69+
cpp_space_between_empty_lambda_brackets = false
70+
cpp_space_before_comma = false
71+
cpp_space_after_comma = true
72+
cpp_space_remove_around_member_operators = true
73+
cpp_space_before_inheritance_colon = true
74+
cpp_space_before_constructor_colon = true
75+
cpp_space_remove_before_semicolon = true
76+
cpp_space_after_semicolon = true
77+
cpp_space_remove_around_unary_operator = true
78+
cpp_space_around_binary_operator = insert
79+
cpp_space_around_assignment_operator = insert
80+
cpp_space_pointer_reference_alignment = ignore
81+
cpp_space_around_ternary_operator = insert
82+
cpp_use_unreal_engine_macro_formatting = false
83+
cpp_wrap_preserve_blocks = never
84+
85+
# Visual C++ Include Cleanup settings
86+
87+
cpp_include_cleanup_add_missing_error_tag_type = suggestion
88+
cpp_include_cleanup_remove_unused_error_tag_type = dimmed
89+
cpp_include_cleanup_optimize_unused_error_tag_type = suggestion
90+
cpp_include_cleanup_sort_after_edits = false
91+
cpp_sort_includes_error_tag_type = none
92+
cpp_sort_includes_priority_case_sensitive = false
93+
cpp_sort_includes_priority_style = quoted
94+
cpp_includes_style = default
95+
cpp_includes_use_forward_slash = true

.github/workflows/msbuild.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: MSBuild
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
env:
10+
SOLUTION_FILE_PATH: .\C-Programming-Examples.sln
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
build:
17+
strategy:
18+
matrix:
19+
platform: [x64, x86, ARM64]
20+
config: [Debug, Release]
21+
fail-fast: false
22+
runs-on: windows-latest
23+
steps:
24+
- name: Source checkout
25+
uses: actions/checkout@main
26+
with:
27+
submodules: recursive
28+
- name: Prepare MSBuild
29+
uses: microsoft/setup-msbuild@main
30+
- name: Build
31+
working-directory: ${{env.GITHUB_WORKSPACE}}
32+
run: msbuild ${{env.SOLUTION_FILE_PATH}} /restore /m /p:Configuration=${{matrix.config}} /p:Platform=${{matrix.platform}} /p:RestorePackagesConfig=true
33+
- name: Run Examples
34+
if: ${{ matrix.platform == 'x64' || matrix.platform == 'x86' }}
35+
working-directory: ${{env.GITHUB_WORKSPACE}}
36+
run: .\OutDir\${{matrix.platform}}\${{matrix.config}}\C-Programming-Examples.exe

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.vs
2+
*.user
3+
*.aps
4+
5+
/packages
6+
/OutDir
7+
IntDir
8+
9+
/*.nupkg

C-Programming-Examples.sln

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.14.36414.22 d17.14
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "C-Programming-Examples", "C-Programming-Examples.vcxproj", "{A652730B-FC03-49AA-8D0C-CDE9E39B281B}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|ARM64 = Debug|ARM64
11+
Debug|x64 = Debug|x64
12+
Debug|x86 = Debug|x86
13+
Release|ARM64 = Release|ARM64
14+
Release|x64 = Release|x64
15+
Release|x86 = Release|x86
16+
EndGlobalSection
17+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
18+
{A652730B-FC03-49AA-8D0C-CDE9E39B281B}.Debug|ARM64.ActiveCfg = Debug|ARM64
19+
{A652730B-FC03-49AA-8D0C-CDE9E39B281B}.Debug|ARM64.Build.0 = Debug|ARM64
20+
{A652730B-FC03-49AA-8D0C-CDE9E39B281B}.Debug|x64.ActiveCfg = Debug|x64
21+
{A652730B-FC03-49AA-8D0C-CDE9E39B281B}.Debug|x64.Build.0 = Debug|x64
22+
{A652730B-FC03-49AA-8D0C-CDE9E39B281B}.Debug|x86.ActiveCfg = Debug|Win32
23+
{A652730B-FC03-49AA-8D0C-CDE9E39B281B}.Debug|x86.Build.0 = Debug|Win32
24+
{A652730B-FC03-49AA-8D0C-CDE9E39B281B}.Release|ARM64.ActiveCfg = Release|ARM64
25+
{A652730B-FC03-49AA-8D0C-CDE9E39B281B}.Release|ARM64.Build.0 = Release|ARM64
26+
{A652730B-FC03-49AA-8D0C-CDE9E39B281B}.Release|x64.ActiveCfg = Release|x64
27+
{A652730B-FC03-49AA-8D0C-CDE9E39B281B}.Release|x64.Build.0 = Release|x64
28+
{A652730B-FC03-49AA-8D0C-CDE9E39B281B}.Release|x86.ActiveCfg = Release|Win32
29+
{A652730B-FC03-49AA-8D0C-CDE9E39B281B}.Release|x86.Build.0 = Release|Win32
30+
EndGlobalSection
31+
GlobalSection(SolutionProperties) = preSolution
32+
HideSolutionNode = FALSE
33+
EndGlobalSection
34+
GlobalSection(ExtensibilityGlobals) = postSolution
35+
SolutionGuid = {1AF7814C-2D5B-4BB5-9476-3B7F72B30D02}
36+
EndGlobalSection
37+
EndGlobal

C-Programming-Examples.vcxproj

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup Label="ProjectConfigurations">
4+
<ProjectConfiguration Include="Debug|ARM64">
5+
<Configuration>Debug</Configuration>
6+
<Platform>ARM64</Platform>
7+
</ProjectConfiguration>
8+
<ProjectConfiguration Include="Debug|Win32">
9+
<Configuration>Debug</Configuration>
10+
<Platform>Win32</Platform>
11+
</ProjectConfiguration>
12+
<ProjectConfiguration Include="Release|ARM64">
13+
<Configuration>Release</Configuration>
14+
<Platform>ARM64</Platform>
15+
</ProjectConfiguration>
16+
<ProjectConfiguration Include="Release|Win32">
17+
<Configuration>Release</Configuration>
18+
<Platform>Win32</Platform>
19+
</ProjectConfiguration>
20+
<ProjectConfiguration Include="Debug|x64">
21+
<Configuration>Debug</Configuration>
22+
<Platform>x64</Platform>
23+
</ProjectConfiguration>
24+
<ProjectConfiguration Include="Release|x64">
25+
<Configuration>Release</Configuration>
26+
<Platform>x64</Platform>
27+
</ProjectConfiguration>
28+
</ItemGroup>
29+
<PropertyGroup Label="Globals">
30+
<VCProjectVersion>17.0</VCProjectVersion>
31+
<Keyword>Win32Proj</Keyword>
32+
<ProjectGuid>{a652730b-fc03-49aa-8d0c-cde9e39b281b}</ProjectGuid>
33+
<RootNamespace>CProgrammingExamples</RootNamespace>
34+
</PropertyGroup>
35+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
36+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
37+
<ConfigurationType>Application</ConfigurationType>
38+
</PropertyGroup>
39+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
40+
<ConfigurationType>Application</ConfigurationType>
41+
<WholeProgramOptimization>true</WholeProgramOptimization>
42+
</PropertyGroup>
43+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
44+
<ConfigurationType>Application</ConfigurationType>
45+
</PropertyGroup>
46+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
47+
<ConfigurationType>Application</ConfigurationType>
48+
</PropertyGroup>
49+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
50+
<ConfigurationType>Application</ConfigurationType>
51+
<WholeProgramOptimization>true</WholeProgramOptimization>
52+
</PropertyGroup>
53+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
54+
<ConfigurationType>Application</ConfigurationType>
55+
<WholeProgramOptimization>true</WholeProgramOptimization>
56+
</PropertyGroup>
57+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
58+
<ImportGroup Label="ExtensionSettings">
59+
</ImportGroup>
60+
<ImportGroup Label="Shared">
61+
</ImportGroup>
62+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
63+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
64+
</ImportGroup>
65+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
66+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
67+
</ImportGroup>
68+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
69+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
70+
</ImportGroup>
71+
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets">
72+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
73+
</ImportGroup>
74+
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
75+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
76+
</ImportGroup>
77+
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
78+
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
79+
</ImportGroup>
80+
<PropertyGroup Label="UserMacros" />
81+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
82+
<ClCompile>
83+
<SDLCheck>true</SDLCheck>
84+
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
85+
</ClCompile>
86+
<Link>
87+
<SubSystem>Console</SubSystem>
88+
</Link>
89+
</ItemDefinitionGroup>
90+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
91+
<ClCompile>
92+
<FunctionLevelLinking>true</FunctionLevelLinking>
93+
<IntrinsicFunctions>true</IntrinsicFunctions>
94+
<SDLCheck>true</SDLCheck>
95+
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
96+
</ClCompile>
97+
<Link>
98+
<SubSystem>Console</SubSystem>
99+
</Link>
100+
</ItemDefinitionGroup>
101+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
102+
<ClCompile>
103+
<SDLCheck>true</SDLCheck>
104+
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
105+
</ClCompile>
106+
<Link>
107+
<SubSystem>Console</SubSystem>
108+
</Link>
109+
</ItemDefinitionGroup>
110+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
111+
<ClCompile>
112+
<SDLCheck>true</SDLCheck>
113+
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
114+
</ClCompile>
115+
<Link>
116+
<SubSystem>Console</SubSystem>
117+
</Link>
118+
</ItemDefinitionGroup>
119+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
120+
<ClCompile>
121+
<FunctionLevelLinking>true</FunctionLevelLinking>
122+
<IntrinsicFunctions>true</IntrinsicFunctions>
123+
<SDLCheck>true</SDLCheck>
124+
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
125+
</ClCompile>
126+
<Link>
127+
<SubSystem>Console</SubSystem>
128+
</Link>
129+
</ItemDefinitionGroup>
130+
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
131+
<ClCompile>
132+
<FunctionLevelLinking>true</FunctionLevelLinking>
133+
<IntrinsicFunctions>true</IntrinsicFunctions>
134+
<SDLCheck>true</SDLCheck>
135+
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
136+
</ClCompile>
137+
<Link>
138+
<SubSystem>Console</SubSystem>
139+
</Link>
140+
</ItemDefinitionGroup>
141+
<ItemGroup>
142+
<ClInclude Include="Public.h" />
143+
</ItemGroup>
144+
<ItemGroup>
145+
<ClCompile Include="DataStructure\LinkedListReverse.c" />
146+
<ClCompile Include="Main.c" />
147+
<ClCompile Include="Print\MultiplicationTable.c" />
148+
<ClCompile Include="Public.c" />
149+
</ItemGroup>
150+
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
151+
<ImportGroup Label="ExtensionTargets">
152+
</ImportGroup>
153+
</Project>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<ItemGroup>
4+
<ClInclude Include="Public.h" />
5+
</ItemGroup>
6+
<ItemGroup>
7+
<Filter Include="Print">
8+
<UniqueIdentifier>{5eb2ab66-1473-460a-8c88-6ff2528a3781}</UniqueIdentifier>
9+
</Filter>
10+
<Filter Include="DataStructure">
11+
<UniqueIdentifier>{599904f4-287c-4a67-bd20-b9d7eca41625}</UniqueIdentifier>
12+
</Filter>
13+
</ItemGroup>
14+
<ItemGroup>
15+
<ClCompile Include="Print\MultiplicationTable.c">
16+
<Filter>Print</Filter>
17+
</ClCompile>
18+
<ClCompile Include="DataStructure\LinkedListReverse.c">
19+
<Filter>DataStructure</Filter>
20+
</ClCompile>
21+
<ClCompile Include="Public.c" />
22+
<ClCompile Include="Main.c" />
23+
</ItemGroup>
24+
</Project>

0 commit comments

Comments
 (0)