   Simple Class Errors
  Can someone please explain to me what I am doing wrong?  I am trying to make a simple class:class Quad {protected:int X;int Y;public:void SetValues(int x, int y) { X, Y = x, y; };};And when I make a new Quad:Quad Billy;Billy.SetValues(5,5);But every time I try to compile, I get these errors:1>c:\users\matt\documents\visual studio 2008\projects\ustest\ustest\objects.h(10) : error C2143: syntax error : missing ';' before '.'1>c:\users\matt\documents\visual studio 2008\projects\ustest\ustest\objects.h(10) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int1>c:\users\matt\documents\visual studio 2008\projects\ustest\ustest\objects.h(10) : error C2371: 'Billy' : redefinition; different basic types1>   c:\users\matt\documents\visual studio 2008\projects\ustest\ustest\objects.h(9) : see declaration of 'Billy'
  This is in Visual Studio 2008, BTW.   ;  Post those two files in entirety: objects.h and whatever file has "Quad Billy" in it.   ;  Objects.h:class Quad {protected:int X;int Y;public:void SetValues(int x, int y) { X, Y = x, y; };};Objects.cpp:#include "Objects.h"Quad Billy;Billy.SetValues(5,5);;  X, Y = x, y; does not do what you think it does. Try X = x; Y = y; instead.EDIT: I hadn't seen your latest post. Anyway, you can't just call a function like that. You'll have to do that inside another function.   ;  This is it.  I have other files, but none of them use these files because I just created them to test classes.  I really have no clue how these errors are occurring.   ;  Oh, that works.  Why does it do that?   ;Quote:Original post by Matthew ShockleyOh, that works.  Why does it do that?What works, and why does it do what?   ;Quote:Original post by Matthew ShockleyOh, that works.  Why does it do that?That's just the proper way of saying what you're trying to say in C++. Assignment is a statement. Statements end in semicolons. To assign a sequence of values to a sequence of variables, you'll have to explicitly put them in lists. For example, you could do:class Quad{protected:   vector<int> mValues;public:   void SetValues(const vector<int>& values) { mValues = values; }};Not that I would recommend this in such a simple case.   ;  You should google for the "comma operator". It doesn't do what you think it does.   