Size not declared

I’ve been following the Ultimate C++ course and I have reached part 2, and I am doing the sorting arrays class. I tried to do the bubble array exercise but couldn’t work it out so I followed the solution Mosh gave but I’ve come to an error I don’t really understand. I have checked the solution against my code several times and I can not find the error it just keeps telling me that “size” was not declared in this scope.
size not declared

Check your compiler version.