user3613174
user3613174

Reputation: 667

how do I initialise an array of pointers to int?

this is annoying me....

Can anybody let me know how to initialise so I can call the function below with parameters.

// arr is typedef'ed to an array on integers

typedef int arr[];

// arr_ptr is a pointer to an array of integers

typedef arr *arr_ptr;

// two parameters, A & B are pointers to array // of integers and N the size of both the arrays

void F(arr_ptr A, arr_ptr B, size_t N)
{
    // array of pointers to int
}

How do I call F with parameters? N is obviously the length of A & B's array but I cant get a function call compiling ok.

Upvotes: 1

Views: 34

Answers (1)

Aniket Sinha
Aniket Sinha

Reputation: 235

try

typedef *arr_ptr[arr.size()];

this should create an array of pointers

Upvotes: 3

Related Questions