1

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.

2
  • 2
    You should mention which programming language your question is about. Commented Sep 17, 2022 at 17:35
  • Assumed C++, will do next time. Thanks Commented Sep 18, 2022 at 12:42

1 Answer 1

3

try

typedef *arr_ptr[arr.size()];

this should create an array of pointers

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks ! Umm...can't see where I mark this as answered so you get your credits. Where do I do that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.