File tree 4 files changed +13
-38
lines changed
4 files changed +13
-38
lines changed Original file line number Diff line number Diff line change 20
20
</ItemGroup >
21
21
<ItemGroup >
22
22
<ClCompile Include =" src\Main.cpp" />
23
+ <ClCompile Include =" src\Static.cpp" />
23
24
</ItemGroup >
24
25
<PropertyGroup Label =" Globals" >
25
26
<VCProjectVersion >16.0</VCProjectVersion >
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\Static.cpp" >
22
+ <Filter >Fichiers sources</Filter >
23
+ </ClCompile >
21
24
</ItemGroup >
22
25
</Project >
Original file line number Diff line number Diff line change 1
1
#include < iostream>
2
2
3
- class Log
4
- {
5
- public:
6
- const int LogLevelError = 0 ;
7
- const int LogLevelWarning = 1 ;
8
- const int LogLevelInfo = 2 ;
9
-
10
- private:
11
- int m_LogLevel = LogLevelInfo;
12
-
13
- public:
14
- void SetLevel (int level)
15
- {
16
- m_LogLevel = level;
17
- }
18
-
19
- void Error (const char * message)
20
- {
21
- if (m_LogLevel >= LogLevelError)
22
- std::cout << " [ERROR]:" << message << std::endl;
23
- }
24
-
25
- void Warn (const char * message)
26
- {
27
- if (m_LogLevel >= LogLevelWarning)
28
- std::cout << " [WARNING]:" << message << std::endl;
29
- }
3
+ extern int s_Variable;
30
4
31
- void Info (const char * message)
32
- {
33
- if (m_LogLevel >= LogLevelInfo)
34
- std::cout << " [INFO]:" << message << std::endl;
35
- }
36
- };
5
+ void Function ();
37
6
38
7
int main ()
39
8
{
40
- Log log ;
41
- log .SetLevel (log .LogLevelError );
42
- log .Warn (" Hello!" );
43
- log .Error (" Hello!" );
44
- log .Info (" Hello!" );
9
+ std::cout << s_Variable << std::endl;
45
10
std::cin.get ();
46
11
}
Original file line number Diff line number Diff line change
1
+ int s_Variable = 5 ;
2
+
3
+ static void Function ()
4
+ {
5
+
6
+ }
You can’t perform that action at this time.
0 commit comments