Sign in to follow this  

Fixed sized array reference as a parameter

This topic is 3738 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Just a very simple question. I'm not sure if I'm messing up the syntax, or if it's just impossible. I'll just lay it out:
void Func(const int &list[10])
{
...
}

int list[10];
Func( list );
Apparently, this is an array of references, which is illegal. I know I can pass by const pointer or by const pointer reference, but I would like the fixed size (10 here) to be an obvious restraint. Both inside the function and for its callers. Thanks for any information.

Share this post


Link to post
Share on other sites

This topic is 3738 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this