Hey guys,
I did a search on the website and Google and couldn't find the answer I was looking for. Most of the answers I found said the compile error did not matter; to ignore the error; or that the error could lead to mistakes -bugs- in future programs.
I understand that it's an issue with comparing assigned and unassigned values, and, for me, this error usually occurs when I'm using a vector size as an end condition on a for loop.
Example:
for (int i = 0; i<numbers.size(); i++)
I was thinking of ways to fix this, but didn't know if this was the best solution... if a solution at all.
Example Fix:
int t = numbers.size();
for (int i = 0; i<t; i++)
The program works fine sans fix, but, as said before, some of the things I have been reading say to fix this compile error because comparing unassigned to assigned values can mess up "big" programs.
Thanks for your help~
K
I did a search on the website and Google and couldn't find the answer I was looking for. Most of the answers I found said the compile error did not matter; to ignore the error; or that the error could lead to mistakes -bugs- in future programs.
I understand that it's an issue with comparing assigned and unassigned values, and, for me, this error usually occurs when I'm using a vector size as an end condition on a for loop.
Example:
for (int i = 0; i<numbers.size(); i++)
I was thinking of ways to fix this, but didn't know if this was the best solution... if a solution at all.
Example Fix:
int t = numbers.size();
for (int i = 0; i<t; i++)
The program works fine sans fix, but, as said before, some of the things I have been reading say to fix this compile error because comparing unassigned to assigned values can mess up "big" programs.
Thanks for your help~
K