So, basically we are trying to find the distance between a plane and the center of a ball in a 2D view of a pooltable program that shoots a ball that bounces the walls of the pooltable.
I was adding humor to my question haha. But only because my professor gave that line of code as a clue to what would be inside one of the functions. I tried using auto and it gave the same result as when using Scalar for distance.
I guess its safe to say the flaw is with other parts of my code, and not because of the variable type.
I realized (after I decided to go to bed) that my post could be taken the wrong way, almost offensively (which is not how I intended it, I swear) so I have to say I'm glad you didn't take it too heavily :D
Are you compiling with C++11 support (some compilers default to the 98/ 03 standard). For example, g++ would require that you use the -std=c++11 flag. If auto still doesn't work, then there maybe something else wrong (hard to believe, right? haha).
Could you post the error messages that you get? You may also need to post more code (or just explain what Scalar, plane and what Vector4D represent if you aren't allowed/ comfortable with actually posting [which can be expected with school assignments]). Without further context it will be hard to tell what is happening (and the people who actually know what they are talking about [so pretty much anyone but me] will have a much more difficult time helping you).