reference to array

Can some one tell me what does the following line mean?
const Array<int>& abc;

then I want to assign abc = foo->get_array() where get_array() returns me a const reference to an array of ints.

I get an error saying reference variable "abc" requires an initializer when I declare it.

How can I use the function get_array() and assign its return value to a variable?
Also, If I write
const Array<int>& abc = foo->get_array();
this seems to work fine. However I want to declare abc first and then use it.

Can some one help me here pls!
FYI: This is not the standard library array that I am using.
const Array<int>& abc; declares a reference to a const object of type Array<int>

I get an error saying reference variable "abc" requires an initializer when I declare it.
Also, If I writeconst Array<int>& abc = foo->get_array(); this seems to work fine.

A const object must be assigned to when it's created. You can't modify it later, otherwise it wouldn't be const.

However I want to declare abc first and then use it.

Then you can not declare it const.
Thanks! :) That helped.
Topic archived. No new replies allowed.