| Gregness (2) | |||||||
|
Hey everyone, I'm using Dev-C++ to write a barebones image processor for my Data structures class and I'm having trouble combining all of my files. From Driver.cpp
image.h
image.cpp
Some of the #includes are commented out because I thought perhaps I had done something wrong, but nothing I tried seemed to help. These is the compiler error I'm getting: ISO C++ forbids declaration of `ImageType' with no type expected `;' before '&' token I get that one for all three of the overloaded operators. So, how exactly to I manage all the #includes so that Dev-C++ will be able to compile my files correctly? Or is there something else going on? | |||||||
|
|
|||||||
| Disch (7378) | |||
|
when making references, the & comes after the typename. Just like your return type. Also, your + and - operators probably shouldn't be returning a reference. And you should also probably make this const correct while you're at it:
| |||
|
|
|||
| Gregness (2) | |
|
That was a rookie mistake on my part, but I'm still getting the "ISO C++ forbids declaration of `ImageType' with no type" error. Is there something wrong with the class specification? | |
|
|
|
| Disch (7378) | |
| what line is giving you that error? | |
|
|
|
| demosthenes2k8 (174) | |
| Are you making sure to finish the class with a };? | |
|
|
|