Created
December 4, 2020 20:17
-
-
Save neilmayhew/28c88f8babaaf2e6e97e02f6e288d269 to your computer and use it in GitHub Desktop.
A test harness for the isPrefix function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
inline int isPrefix(std::string pre, std::string str) | |
{ | |
return str.compare(0, pre.size(), pre); | |
} | |
int main(int argc, char const *argv[]) | |
{ | |
std::cout << isPrefix(argv[1], argv[2]) << std::endl; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment