The charge of C2O4 is -2 because it is a polyatomic ion. It is true that the oxidation number of the carbon atoms in the compound C2O2-4 is typically both the same atoms, therefore it can be calculated as the following,
Oxygen always has an oxidation number of oxygen is -2 and that of carbon is unknown so we say x
The equation will be then
2x+4x (-2) =-2
The oxidation number of the carbons + the oxidation numbers of the oxygens must equal -2. That of oxygen will always be -2 save in water which is -1 and of2 where it is +2. For the carbons its oxidation number has to be +6. In this equation there are 2 carbon atoms, each should give +3 each.
In this molecule the oxygen atom overall charge can also be calculated like this; Since there are 4 atoms.
The overall charge of the atom would be
4 x(-2) = -8
And that of carbon would is +3