0

Hello. I need an example of how to pass an array of pointers to objects as a parameter to a function or a constructor. It's urgent. Please help me. Thank you.

2
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by Narue
0

Do you know how to pass an array of pointers to int? It's the same thing, just with a different pointer type:

void duh ( int *array[], size_t size );
0

Do you know how to pass an array of pointers to int? It's the same thing, just with a different pointer type:

void duh ( int *array[], size_t size );

I forgot to mention it's a 2 dimensional array. Sorry. Thanks for your help so far. It's rather enlightening

0

>I forgot to mention it's a 2 dimensional array.
And I forgot to mention that you can just copy the declaration and be done with it:

#include <cstddef> // For size_t

void duh ( int array[5][10], std::size_t x, std::size_t y );

int main()
{
  int array[5][10];

  duh ( a, 5, 10 );
}

You'd probably rather use a vector than an array. They're easier to work with.

Edited by Narue: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.