Hi,
I have two problems.
I have a class a called Edit that contains the following:
Header
Problem 1:
Now, the rubout function takes an index and it's supposed to do something with this index in the char text[]. To be more specific, it's supposed to remove the char at the index position and pack the array.
The thing is when I try to get the length of the char tex[] I get this:
Problem 2:
When I call the setCharAt(int index, char ch) it looks like this:
The error I get for this is:
What am I doing wrong?
Cheers.
I have two problems.
I have a class a called Edit that contains the following:
Header
Code:
void setCharAt(int index,char ch); void rubout(int index) const; char text[];
Now, the rubout function takes an index and it's supposed to do something with this index in the char text[]. To be more specific, it's supposed to remove the char at the index position and pack the array.
The thing is when I try to get the length of the char tex[] I get this:
Code:
request for member `length' in `this->Edit::text', which is of on-aggregate type `char[0]'
When I call the setCharAt(int index, char ch) it looks like this:
Code:
Edit::setCharAt(1,'v');
Code:
passing `const Edit' as `this' argument of `void Edit::setCharAt(int, char)' discards qualifiers
Cheers.
Comment