Hi everyone!
I'm totally new at C++ but quite good at Java. I know the syntax basics and that kind of stuff in C++ but when it comes to using .h files in my .ccp programs I'm totally on bare bottom.
I use Dev-C++ 4.9.9.2 to compile my C++ programming.
Please take a look at my Shapes.h file:
class Shapes
{
public:
Shapes(char shape, int x, int y, int width, int height);
};
And at my Shapes.cpp:
#include <iostream>
#include "Shapes.h"
using namespace std;
Shapes::Shapes(char shape, int x, int y, int width, int height);
{
cout << "You created a: " << shape " shape. At X: " << x " At Y: " << y " Width: " << width " Height: " << height << endl;
}
int main()
{
new Shapes('r', 10, 10, 10, 10);
system("pause");
return 0;
}
And this is the code the compiler generated:
2 C:\Documents and Settings\Benjamin Dahse\Shapes.cpp In file included from C:\Documents and Settings\Benjamin Dahse\Shapes.cpp
5:3 C:\Documents and Settings\Benjamin Dahse\Shapes.h [Warning] no newline at end of file
5 C:\Documents and Settings\Benjamin Dahse\Shapes.cpp declaration of `Shapes::Shapes(char, int, int, int, int)' outside of class is not definition
6 C:\Documents and Settings\Benjamin Dahse\Shapes.cpp expected unqualified-id before '{' token
6 C:\Documents and Settings\Benjamin Dahse\Shapes.cpp expected `,' or `;' before '{' token
16:2 C:\Documents and Settings\Benjamin Dahse\Shapes.cpp [Warning] no newline at end of file
Please help me and remember that I'm new to C++ so I might be hard to explain stuff too.. I don't know.. If that's the case compare it to Java and I'll probaly get it :P