beginner

hi can any one tell me what is wrong with this code? thanks!

const int SIZE = 7;
string owners[SIZE] = {"Jack", "Jill", "Mary", "Adam","Mottu"};

string * const streetX = &owners;
*(streetX + 1) = "Peter";

cout << "The owners of the houses in StreetX are "<<endl;
for(int i=0; i< SIZE; i++)
cout<< *(streetX + i)<< endl;
This would be better suited to the Beginners section. And it sounds quite like homework. What progress have you made on it yourself?
Indeed. You can move it yourself through edit button.
The problem is that you don't know that the type of owners is.
Hint: a[b] is equivalent to *(a+b), so what is a (if b is an integer) ?
Topic archived. No new replies allowed.