diff options
| author | JacobAKnox <[email protected]> | 2021-10-30 10:17:32 -0700 |
|---|---|---|
| committer | JacobAKnox <[email protected]> | 2021-10-30 10:17:32 -0700 |
| commit | 89ec8373bb3b9a18c7ab8dde76c66dc17fc04cbf (patch) | |
| tree | 76ae896117c180809ba0b8a5bf92dd16c633e9eb /10b/10.8.7/funcs.cpp | |
| parent | 10.a finished (diff) | |
| download | cst116-lab5-jacobaknox-master.tar.xz cst116-lab5-jacobaknox-master.zip | |
Diffstat (limited to '10b/10.8.7/funcs.cpp')
| -rw-r--r-- | 10b/10.8.7/funcs.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/10b/10.8.7/funcs.cpp b/10b/10.8.7/funcs.cpp new file mode 100644 index 0000000..80a7795 --- /dev/null +++ b/10b/10.8.7/funcs.cpp @@ -0,0 +1,30 @@ + +#include "header.h" +#include <iostream> + +using namespace std; + +void GetInput(char s1[], char s2[], int& amt) +{ + cout << "Input the first stirng: "; + cin >> s1; + + cout << "Input the second string: "; + cin >> s2; + + cout << "How many charcters to compare: "; + cin >> amt; +} + +bool Compare(char s1[], char s2[], int n) +{ + for (int i = 0; i < n; i++) + { + if (!(s1[i] == s2[i])) + { + return false; + } + } + + return true; +} |