Ok, so I was creating a program and I ran into a problem. I needed to return an array. Now, usually, I'd just return a pointer, but under the circumstances, I couldn't. So I descided to use the beauty of OOP and create my own variable that carries array info.
So here's my question. How do I program the '[' and ']' operators. Or, even more so, how do I create a variable? This is all I have so far:
PHP Code:
class array
{
int length;
int value[100];
public:
array(int a[])
{
for(int x = 0; x < 100; x++)
{
if(!a[x] == NULL)
{
a[x] = value[x];
}
else
{
break;
}
}
}
};