-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathmain.cc
executable file
·55 lines (44 loc) · 1.22 KB
/
main.cc
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
#include <cstdlib>
#include <iostream>
#include <memory>
namespace Color {
enum Key : int {
Red = 3,
Green = 1,
Blue = 9,
};
static const Key RGB[] = {
Red,
Green,
Blue,
};
static const int iRGB[] = {
Red,
Green,
Blue,
};
}
void way1(int const *rgb)
{
std::cout << rgb[0] << rgb[1] << rgb[2] << std::endl;
}
void way2(int const rgb[3])
{
std::cout << rgb[0] << rgb[1] << rgb[2] << std::endl;
}
void way3(int const rgb[])
{
std::cout << rgb[0] << rgb[1] << rgb[2] << std::endl;
}
int main(int argc, char const* argv[]) {
// way1(Color::RGB);
// note: candidate function not viable: no known conversion from 'const Color::Key [3]' to 'const int *' for 1st argument
// way2(Color::RGB);
// note: candidate function not viable: no known conversion from 'const Color::Key [3]' to 'const int *' for 1st argument
// way3(Color::RGB);
// note: candidate function not viable: no known conversion from 'const Color::Key [3]' to 'const int *' for 1st argument
// way1(Color::iRGB); // 319
// way2(Color::iRGB); // 319
// way3(Color::iRGB); // 319
return EXIT_SUCCESS;
}