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

  • SEARCH
  • Home
  • 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 8215209
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T11:42:25+00:00 2026-06-07T11:42:25+00:00

Given: SInt16 *samples = NULL; What does (char **)(&samples) declare? Edit to show actual

  • 0

Given: SInt16 *samples = NULL;

What does (char **)(&samples) declare?

Edit to show actual use case:

CMBlockBufferGetDataPointer(audioBlockBuffer, audioBlockBufferOffset, &lengthAtOffset, &totalLength, (char **)(&samples));
//  CMBlockBufferGetDataPointer(<CMBlockBufferRef theBuffer>, <size_t offset>, <size_t *lengthAtOffset>, <size_t *totalLength>, <char **dataPointer>)
  • 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-07T11:42:26+00:00Added an answer on June 7, 2026 at 11:42 am

    Update: The original question was asking simply What does (char **)(&samples) declare? As such, in my original answer I tried to outline the possible uses of that syntax in the abstract. But subsequently it was clarified that this was for a parameter to CMBlockBufferGetDataPointer. But I’ll leave my original answer for the sake of completeness.

    Original answer:

    This syntax has one of two possible interpretations. First, this syntax can be used as a pointer to a pointer of a SInt16 which has been cast to a pointer to a pointer of a char. By the way, Apple uses the term indirect reference for these pointers to pointers. Or, second, this could be a pointer to an array of SInt16 which has been cast to a pointer to an array of char. It depends upon how this (char **)&samples is being used.

    Focusing on the first interpretation, in your example the variable samples is defined to be (SInt16 *), a pointer (or direct reference) to a SInt16 (a signed short integer). Thus &samples is the address of that that samples pointer, which could properly be used in any situation where you need to pass a pointer to a pointer (an indirect reference) of a SInt16, namely (SInt16 **).

    In terms of where you’d use a pointer to a pointer, an indirect reference, it’s frequently used when you have a method that will allocate some memory for some object and it needs to update one of your pointers with a reference to this new object. The most common Cocoa example of this construct is the frequent use of (NSError **). You can see examples of this in Apple’s Error Handling Programming Guide.

    What’s strange about your example, is that you’re casting &samples, your indirect reference to a SInt16 (or a pointer to an array of SInt16), to be a (char **), a char indirect reference (or an array of char). That sends a shudder down the spine of all of us reformed C programmers. If you do this, you should be very, very comfortable with the code that is using this construct as this is a little dangerous. But I realize that we’re sometimes constrained by legacy code.

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

Sidebar

Related Questions

Given the following code, The buttons does not show up on the toolbar. Is
Given a table of structure: CREATE TABLE [dbo].[Example]( [FiscalYear] INT NOT NULL, [Hours] [decimal](28,
Given the exampleString = [9+[7*3+[1+2]]-5] How does one extract and store elements enclosed by
Given the above dynamically generated text (meaning that I can't just use an image),
Given two or more samples of text, specifically segments of code, what's the most
Given: http://www.foo.com/bar.html#baz How does one get the baz ? I can't find this as
Given that the web application doesn't have su privileges, I'd like to execute a
Given this method to work on a HTML page in a webbrowser: bool semaphoreForDocCompletedEvent;
Given an NSMutableArray of dynamic CGPoint s, what is the fastest and most efficient
Given a certain date, I want to set the value of a cell with

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.