Problem with constructor re-definition

This is a discussion on Problem with constructor re-definition within the C++ Programming forums, part of the General Programming Boards category; Basicly I'm trying to translate Java's collections API ArrayList to a raw version in c++.
Code:
//ArrayList.h
#ifndef _ARRAYLIST_H_
#define ...

Unexepected end of file and re-definition usually means an unmatched { somewhere. I beleve you also need to include an initalizer (int initialCapacity = ARRAYLIST_INITIALCAPACITY) in the defintion(the cpp file). Small constructors are frequenly just written inline, this will bloat compile time and sometimes exe size, but is usually a lot simpler.

You also cannot use new void[], there is no such thing as a void, you can have a pointer to void, "return" a void or "pass" a void, but these are all ways of saying either do nothing or, in the case of a pointer, have a raw machine address.

You also may be having a problem in that Container may not have a member named ArrayList.

Before you tackle pointers to void or arrays of pointers to void, I recomend you build your container out of the existing stl vector The most Javaish way is probably a vector of smart pointers to a common base type. You can also use a vector of pointers to objects decended from a type with a virtual clone() method, that will allow deep copying.

Thanks for the help, but your mixing on stuff I still haven't considered... the problem is that the compiler is, stupidly, assuming that I defined the same constructors and operator twice. Plus I have another class, in the same workspace that's written exactly the same way, and compiles well.
And the "int initialCapacity = ARRAYLIST_INITIALCAPACITY" isn't necessary in the cpp file.

This compiles well. The above class, that is wirtten the same way, doesn't!!

I solved it... incredible.. A single comma made all that noise!!! bah! thankx

c/c++ compilers generally continue to try to compile, even though its obvious that the wheels have come off, it's kind of cute. Although, if the compiler could produce an "you forgot a comma here" error, you wouldn't need to include any commas .