-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcpp_feature.cpp
More file actions
57 lines (40 loc) · 1.06 KB
/
cpp_feature.cpp
File metadata and controls
57 lines (40 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// cpp_feature.cpp : Defines the entry point for the console application.
//
#include "tchar.h"
#include <iostream>
//#define TEST_INHERITANCE
#define TEST_STRING_EXAMPLE
#ifdef TEST_OVERLOAD_FUNCTION
#include "feature_overload_function.h"
#endif
#ifdef TEST_INHERITANCE
#include "feature_inheritance.h"
#endif
#ifdef TEST_STRING_EXAMPLE
#include "feature_string_example.h"
#endif
int _tmain(int argc, _TCHAR* argv[])
{
#ifdef TEST_OVERLOAD_FUNCTION
FeatureOverloadFunction fof;
int t = 2013;
fof.F(t);
#endif
#ifdef TEST_INHERITANCE
Inheritance inheritance;
std::cout<<"i from Inheritance: "<<inheritance.getII()<<std::endl;
Inheritance1 inheritance1;
std::cout<<"i from Inheritance1: "<<inheritance1.getII()<<std::endl;
std::cout<<"i get from Inheritance1 display fun: "<<std::endl;
inheritance1.display();
#endif
#ifdef TEST_STRING_EXAMPLE
String s;
std::cout<<s.c_str()<<s.length()<<std::endl;
s += "ddd";
std::cout<<s.c_str()<<s.length()<<std::endl;
String r = s + s;
std::cout<<r.c_str()<<r.length()<<std::endl;
#endif
return 0;
}