Skip to content

Commit ca3b41c

Browse files
committed
Add Control Flow in C++
1 parent 164de7c commit ca3b41c

File tree

7 files changed

+61
-48
lines changed

7 files changed

+61
-48
lines changed

HelloWorld/HelloWorld.vcxproj

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@
1919
</ProjectConfiguration>
2020
</ItemGroup>
2121
<ItemGroup>
22-
<ClCompile Include="Log.cpp" />
23-
<ClCompile Include="Main.cpp" />
22+
<ClCompile Include="src\Log.cpp" />
23+
<ClCompile Include="src\Main.cpp" />
2424
</ItemGroup>
2525
<ItemGroup>
26-
<ClInclude Include="Log.h" />
26+
<ClInclude Include="src\Log.h" />
2727
</ItemGroup>
2828
<PropertyGroup Label="Globals">
2929
<VCProjectVersion>16.0</VCProjectVersion>
@@ -77,6 +77,22 @@
7777
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
7878
</ImportGroup>
7979
<PropertyGroup Label="UserMacros" />
80+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
81+
<OutDir>$(SolutionDir)\bin\$(Platform)\$(Configuration)\</OutDir>
82+
<IntDir>$(SolutionDir)\bin\intermediates\$(Platform)\$(Configuration)\</IntDir>
83+
</PropertyGroup>
84+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
85+
<OutDir>$(SolutionDir)\bin\$(Platform)\$(Configuration)\</OutDir>
86+
<IntDir>$(SolutionDir)\bin\intermediates\$(Platform)\$(Configuration)\</IntDir>
87+
</PropertyGroup>
88+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
89+
<OutDir>$(SolutionDir)\bin\$(Platform)\$(Configuration)\</OutDir>
90+
<IntDir>$(SolutionDir)\bin\intermediates\$(Platform)\$(Configuration)\</IntDir>
91+
</PropertyGroup>
92+
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
93+
<OutDir>$(SolutionDir)\bin\$(Platform)\$(Configuration)\</OutDir>
94+
<IntDir>$(SolutionDir)\bin\intermediates\$(Platform)\$(Configuration)\</IntDir>
95+
</PropertyGroup>
8096
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
8197
<ClCompile>
8298
<WarningLevel>Level3</WarningLevel>

HelloWorld/HelloWorld.vcxproj.filters

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
</Filter>
1616
</ItemGroup>
1717
<ItemGroup>
18-
<ClCompile Include="Main.cpp">
18+
<ClCompile Include="src\Main.cpp">
1919
<Filter>Fichiers sources</Filter>
2020
</ClCompile>
21-
<ClCompile Include="Log.cpp">
21+
<ClCompile Include="src\Log.cpp">
2222
<Filter>Fichiers sources</Filter>
2323
</ClCompile>
2424
</ItemGroup>
2525
<ItemGroup>
26-
<ClInclude Include="Log.h">
26+
<ClInclude Include="src\Log.h">
2727
<Filter>Fichiers d%27en-tête</Filter>
2828
</ClInclude>
2929
</ItemGroup>

HelloWorld/HelloWorld.vcxproj.user

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<PropertyGroup />
3+
<PropertyGroup>
4+
<ShowAllFiles>false</ShowAllFiles>
5+
</PropertyGroup>
46
</Project>

HelloWorld/Main.cpp

Lines changed: 0 additions & 41 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.

HelloWorld/src/Main.cpp

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#include <iostream>
2+
#include "Log.h"
3+
4+
int main()
5+
{
6+
for (int i = 0; i < 5; i++)
7+
{
8+
if (i > 2)
9+
continue;
10+
Log("Hello World!");
11+
std::cout << i << std::endl;
12+
}
13+
14+
Log("===========================");
15+
16+
for (int i = 0; i < 5; i++)
17+
{
18+
if ((i + 1) % 2 == 0)
19+
break;
20+
Log("Hello World!");
21+
std::cout << i << std::endl;
22+
}
23+
24+
Log("===========================");
25+
26+
for (int i = 0; i < 5; i++)
27+
{
28+
if ((i + 1) % 2 == 0)
29+
return 0;
30+
Log("Hello World!");
31+
std::cout << i << std::endl;
32+
}
33+
34+
return 0;
35+
std::cin.get(); // ==> Dead Code
36+
}

0 commit comments

Comments
 (0)