From 4262dd5cf5acf9effb9772fa43a77d94fdcd4b3e Mon Sep 17 00:00:00 2001 From: Mattrixwv Date: Tue, 9 Jun 2020 00:15:25 -0400 Subject: [PATCH] Fixed warning comparing signed and unsigned ints --- Source/Problem30.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Problem30.cpp b/Source/Problem30.cpp index fd7bdf6..3fc3a5e 100644 --- a/Source/Problem30.cpp +++ b/Source/Problem30.cpp @@ -40,7 +40,7 @@ std::vector Problem30::getDigits(uint64_t num){ //The easiest way to get the individual digits of a number is by converting it to a string std::string digits = std::to_string(num); //Holds a string representation of num //Start with the first digit, convert it to an integer, store it in the vector, and move to the next digit - for(int cnt = 0;cnt < digits.size();++cnt){ + for(unsigned int cnt = 0;cnt < digits.size();++cnt){ listOfDigits.push_back(std::stoi(digits.substr(cnt, 1))); } //Return the list of digits