File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -55,19 +55,22 @@ In this example, you'll compile a header file as a header unit. Start by creatin
55
55
56
56
int main ()
57
57
{
58
- PrintPythogoreanTriple (2,3);
58
+ PrintPythagoreanTriple (2,3);
59
59
return 0;
60
60
}
61
61
```
62
62
1 . Add a header file called ` Pythagorean.h ` , and replace its content with this code:
63
63
``` cpp
64
- #pragma once
64
+ #ifndef PYTHAGOREAN
65
+ #define PYTHAGOREAN
66
+
65
67
#include <iostream>
66
68
67
- void PrintPythogoreanTriple (int a, int b)
69
+ void PrintPythagoreanTriple (int a, int b)
68
70
{
69
71
std::cout << "Pythagorean triple a:" << a << " b:" << b << " c:" << a*a + b*b << std::endl;
70
72
}
73
+ #endif
71
74
```
72
75
73
76
To enable header units, first set the **C++ Language Standard** to [`/std:c++latest`](./reference/std-specify-language-standard-version.md).
You can’t perform that action at this time.
0 commit comments