int main() { setvbuf(stdout, NULL, _IONBF, 0); int size = 20; char arr[size], arr2[size]; //get input for the first string and store in char array(arr) scanf("%s", &arr); //get input string and store in char array(arr2) to find if that string exists as substring. scanf("%s", &arr2); int arrSize = sizeOfCharArray(arr); int arr2Size = sizeOfCharArray(arr2); bool flag = containsSubString(arr, arr2, arrSize, arr2Size); printContainsSubstring(flag, arr2Size); // // nodeLL *root; // root = (nodeLL *)malloc(sizeof(nodeLL)); // root->data = 1; // root return EXIT_SUCCESS; }
// a small test verifying that the given substr is contained within the given string bool notContainsSubString(const string& str, const string& substr) { return !containsSubString(str, substr); }