File tree Expand file tree Collapse file tree 6 files changed +29
-49
lines changed
enc_temp_folder/da161bb8f251f3ed50cc60fc5881cf20 Expand file tree Collapse file tree 6 files changed +29
-49
lines changed Original file line number Diff line number Diff line change 19
19
</ProjectConfiguration >
20
20
</ItemGroup >
21
21
<ItemGroup >
22
- <ClCompile Include =" src\Log.cpp" />
23
22
<ClCompile Include =" src\Main.cpp" />
24
23
</ItemGroup >
25
- <ItemGroup >
26
- <ClInclude Include =" src\Log.h" />
27
- </ItemGroup >
28
24
<PropertyGroup Label =" Globals" >
29
25
<VCProjectVersion >16.0</VCProjectVersion >
30
26
<Keyword >Win32Proj</Keyword >
Original file line number Diff line number Diff line change 18
18
<ClCompile Include =" src\Main.cpp" >
19
19
<Filter >Fichiers sources</Filter >
20
20
</ClCompile >
21
- <ClCompile Include =" src\Log.cpp" >
22
- <Filter >Fichiers sources</Filter >
23
- </ClCompile >
24
- </ItemGroup >
25
- <ItemGroup >
26
- <ClInclude Include =" src\Log.h" >
27
- <Filter >Fichiers d%27en-tête</Filter >
28
- </ClInclude >
29
21
</ItemGroup >
30
22
</Project >
Original file line number Diff line number Diff line change
1
+ #include < iostream>
2
+
3
+ #define LOG (x ) std::cout << x << std::endl
4
+
5
+ int main ()
6
+ {
7
+ int var = 8 ;
8
+ int * ptr = &var;
9
+ *ptr = 10 ;
10
+ LOG (var);
11
+
12
+ char * buffer = new char [8 ]; // => 8 bytes of memory, return a pointer to the beginning of that block of memory
13
+ memset (buffer, 0 , 8 );
14
+
15
+ char ** cptr = &buffer; // =>
16
+
17
+ delete[] buffer;
18
+ std::cin.get (); // ==> Dead Code
19
+ }
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
1
#include < iostream>
2
- #include " Log.h"
2
+
3
+ #define LOG (x ) std::cout << x << std::endl
3
4
4
5
int main ()
5
6
{
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
- }
7
+ int var = 8 ;
8
+ int * ptr = &var;
9
+ *ptr = 10 ;
10
+ LOG (var);
23
11
24
- Log (" ===========================" );
12
+ char * buffer = new char [8 ]; // => 8 bytes of memory, return a pointer to the beginning of that block of memory
13
+ memset (buffer, 0 , 8 );
25
14
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
- }
15
+ char ** cptr = &buffer; // => &buffer means get the memory address reference of the integer (pointer) that referenced a 8 bytes of char data
33
16
34
- return 0 ;
17
+ delete[] buffer ;
35
18
std::cin.get (); // ==> Dead Code
36
19
}
You can’t perform that action at this time.
0 commit comments