Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8012869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:27:58+00:00 2026-06-04T19:27:58+00:00

There is a function with a header such as this: BPS_API int dialog_event_get_filebrowse_filepaths(bps_event_t* event,

  • 0

There is a function with a header such as this:

BPS_API int dialog_event_get_filebrowse_filepaths(bps_event_t* event,
                                            char** file_paths[], int* num_paths);

This is from BlackBerry 10’s Native SDK for anyone wondering (it can be found here).

The question is: what am I supposed to provide as the second argument. This function should populate an array of char pointers in order to return the file paths selected.

I tried to call it this way:

char* ar[2];
dialog_event_get_filebrowse_filepaths(event, &ar, &number_paths);

And I am getting an error from QNX Momentics as such:

cannot convert 'char * (*)[2]' to char * * * for argument 2 to int
dialog_event_get_filebrowse_filepaths(bps_event_t *, char * * *, int *)

This seems the most logical way to call it. It needs the memory address of an array of pointer in order to set them, as far as I understand.
However, if I declare:

char** ar[2];
dialog_event_get_filebrowse_filepaths(event, ar, &number_paths);

It works, but this way I created an array of pointers to char pointers (an array of arrays of char*). Is this what I should really provide to the function?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T19:27:59+00:00Added an answer on June 4, 2026 at 7:27 pm

    The documentation really should have been more explicit, but I’m pretty sure this is what the function expects:

    First, a few rules of thumb to help decode the function:

    • the type is really equivalent to a char***. This means we have to find a meaning for three pointers.
    • a string in C is a char* (leaving out the const for brevity). As we expect the function to populate an array of strings, that’s one * accounted for.
    • an array in C is generally represented by a pointer. So that’s the second *.
    • “output parameters” can be handled in one of two ways: either the caller allocates memory, and passes a pointer, telling callee where to write its data, or the caller does not allocate any memory, and simply passes in a pointer to a pointer. The callee will then modify the “innermost” pointer to point to a chunk of memory allocated by the callee itself. The second approach would account for the last *. This also explains the documentation note that The memory holding these values must be freed using bps_free() when no longer needed — because the memory was allocated by the library function, rather than by you, it is important that you use the correct free function.

    So, the function should be called like this:

    char** strs;
    dialog_event_get_filebrowse_filepaths(foo, &strs, bar);
    

    When the function returns, strs will point to the first entry of an array of strings allocated by dialog_event_get_filebrowse_filepaths.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any javascript function, to parse the first line of the http header?
I can't understand such situation: I have a site template and in header there
When I put this in my header: <script> function checkiffinished() { var n =
Is there a way to get the exact Headers sent by function like file_get_contents()
In the header of C++11, there are three new functions for conversion between number
There is function in which a new window is opened and shown. I want
Is there any function in clojure which calculates the boolean value of the given
Is there python function in standard library like def cond(condition, true, false): if condition:
Is there a function in Apple's library that can reverse the order of the
Is there a function equivalent to mysql_num_rows to count the number of columns in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.