From 4fd17c59c773df2ad91f1fd030541c4ffdd88ea9 Mon Sep 17 00:00:00 2001 From: "ansari.rayyan@outlook.com" Date: Tue, 16 Nov 2021 21:38:29 -0800 Subject: Lab7 Answer V2 --- CST116F2021-Lab7/CST116F2021-Lab7.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CST116F2021-Lab7/CST116F2021-Lab7.cpp b/CST116F2021-Lab7/CST116F2021-Lab7.cpp index f34c751..6293334 100644 --- a/CST116F2021-Lab7/CST116F2021-Lab7.cpp +++ b/CST116F2021-Lab7/CST116F2021-Lab7.cpp @@ -42,11 +42,11 @@ void findStringInArray(string u, string strArray[100], int arrayLen) { for (int i = 0; i < arrayLen; i++) { - for (int x = 0; x < strArray[i].length() - ulen; x++) { + for (int x = 0; x < strArray[i].length(); x++) { - cout << strArray[i].substr(x, x + ulen) << "\n"; + //cout << strArray[i].substr(x, x + ulen) << "\n"; - if (strArray[i].substr(x, x + ulen) == u.substr(0, ulen)) { + if (strArray[i].substr(x, ulen) == u.substr(0, ulen)) { -- cgit v1.2.3