-4

I am trying to get this function to work, but I keep getting, What is the solution ?

if (size_t i >0 && DailyPOCs.size()>0 && DailyPOCs.size()>dayNumber);

error C2059: syntax error: '>'

  • 4
    You have an errant `size_t` – drescherjm Nov 28 '19 at 01:06
  • 1
    What does "`size_t I >0`" supposed to accomplish? – Sam Varshavchik Nov 28 '19 at 01:06
  • `size_t i` looks like the syntax for a declaration of a variable. Probably you want to *use* `i`, not declare it here. A variable is *used* simply by using its name, i.e. `i`, without any type. – walnut Nov 28 '19 at 01:07
  • thank you, I updated the code so that you can see better – Anthony Nov 28 '19 at 03:11
  • @Anthony The original line is nowhere in your updated code. Please ask only one question at at time. If you have a new error message that you need to get solved, then ask a new question for it. Also post a [repro] instead of code snippets without context. – walnut Nov 28 '19 at 03:28

1 Answers1

1

You declared size_t i but not give it an initial value to compare. So, I suggest 1 way to do which is:

size_t i = 0 //Give it value above here. Zero is just an example
if(i > 0 && DailyPOCs.size()>  0 && DailyPOCs.size() > dayNumber)
{
     //Do your work here
}