Skip to content

Commit 16ec5f5

Browse files
committed
finish "step1":exercise 3
1 parent 321db52 commit 16ec5f5

4 files changed

Lines changed: 8 additions & 2 deletions

File tree

‎.gitignore‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,6 @@ CTestTestfile.cmake
3030
# ===== OS =====
3131
.DS_Store
3232
Thumbs.db
33+
Step1/.cache/clangd/index/MathFunctions.cxx.202E5E417D0E2065.idx
34+
Step1/.cache/clangd/index/MathFunctions.h.25429671B54EAD80.idx
35+
Step1/.cache/clangd/index/Tutorial.cxx.704C168B3F6B49A5.idx

‎Step1/CMakeLists.txt‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ Tutorial/Tutorial.cxx)
1111

1212
# TODO7: Add the MathFunctions library as a linked dependency
1313
# to the Tutorial target
14-
14+
target_link_libraries(Tutorial
15+
PRIVATE
16+
MathFunction)
1517
# TODO11: Add the Tutorial subdirectory to the project
1618

1719
# TODO5: Add a library target called MathFunctions to the project

‎Step1/Tutorial/Tutorial.cxx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <string>
55

66
// TODO8: Include the MathFunctions header
7+
#include "MathFunctions.h"
78

89
int main(int argc, char* argv[])
910
{
@@ -17,7 +18,7 @@ int main(int argc, char* argv[])
1718

1819
// TODO9: Use the mathfunctions::sqrt function
1920
// calculate square root
20-
double const outputValue = std::sqrt(inputValue);
21+
double const outputValue = mathfunctions::sqrt(inputValue);
2122
std::cout << "The square root of " << inputValue << " is " << outputValue
2223
<< std::endl;
2324
}

‎Step1/Tutorial/hello‎

-24.1 KB
Binary file not shown.

0 commit comments

Comments
 (0)