Please tell me what is wrong with this code

when I run this code I get an error array::operator[] must return a value
now do I have to use a pointer to declare an array or just
declare array[8] in my array::array(void) once again I am newbie thanks

#include "Array.h"
#include <stdexcept>


Array::Array (void)
{


}


Array::Array (size_t length)
{

}


Array::Array (size_t length, char fill)
{

}


Array::Array (const Array & array)
{

}

Array::~Array (void)
{

}

const Array & Array::operator = (const Array & rhs)
{
return *this;
}


char & Array::operator [] (size_t index)
{
//return *this;
}

const char & Array::operator [] (size_t index) const
{

}

char Array::get (size_t index) const
{
return 0;
}

void Array::set (size_t index, char value)
{

}


void Array::resize (size_t new_size)
{

}

int Array::find (char ch) const
{
return 0;
}


int Array::find (char ch, size_t start) const
{
return 0;
}

bool Array::operator == (const Array & rhs) const
{
return true;
}

bool Array::operator != (const Array & rhs) const
{
return true;
}

void Array::fill (char ch)
{

}



Can you explain what these mean?
1
2
3
4
5
6
7
8
9
char & Array::operator [] (size_t index)
{
//return *this;
}

const char & Array::operator [] (size_t index) const
{

}
Please post Array.h.
And don't forget code tags.
this is my array.h
class Array
{
public:


Array (void);






Array (size_t length);



Array (size_t length, char fill);


~Array (void);


const Array & operator = (const Array & rhs);


size_t size (void) const;


size_t max_size (void) const;


char & operator [] (size_t index);


const char & operator [] (size_t index) const;


char get (size_t index) const;

void set (size_t index, char value);


void resize (size_t new_size);


int find (char ch) const;


int find (char ch, size_t start) const;


bool operator == (const Array & rhs) const;


bool operator != (const Array & rhs) const;


void fill (char ch);

private:

char * data_;


size_t cur_size_;


size_t max_size_;
};



#endif // !defined _ARRAY_H_

I have the same advice for this project as I did for the one found here:
http://www.cplusplus.com/forum/general/18326/

Focus on the constructor(s) and destructor first.
Hi Moorecm thanks this is exactly what I needed. I have grab the concept now I will keep you posted on my results
also make your post clean so people will help you.. read this..
http://www.cplusplus.com/articles/firedraco1/
Topic archived. No new replies allowed.