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 58295
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T17:49:32+00:00 2026-05-10T17:49:32+00:00

From the reading that I have done, Core Audio relies heavily on callbacks (and

  • 0

From the reading that I have done, Core Audio relies heavily on callbacks (and C++, but that’s another story).

I understand the concept (sort of) of setting up a function that is called by another function repeatedly to accomplish a task. I just don’t understand how they get set up and how they actually work. Any examples would be appreciated.

  • 1 1 Answer
  • 2 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. 2026-05-10T17:49:33+00:00Added an answer on May 10, 2026 at 5:49 pm

    There is no ‘callback’ in C – not more than any other generic programming concept.

    They’re implemented using function pointers. Here’s an example:

    void populate_array(int *array, size_t arraySize, int (*getNextValue)(void)) {     for (size_t i=0; i<arraySize; i++)         array[i] = getNextValue(); }  int getNextRandomValue(void) {     return rand(); }  int main(void) {     int myarray[10];     populate_array(myarray, 10, getNextRandomValue);     ... } 

    Here, the populate_array function takes a function pointer as its third parameter, and calls it to get the values to populate the array with. We’ve written the callback getNextRandomValue, which returns a random-ish value, and passed a pointer to it to populate_array. populate_array will call our callback function 10 times and assign the returned values to the elements in the given array.

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

Sidebar

Related Questions

From all the reading that I have done, I have understood that using user-agent
I'm sort of lost on this. I have an application that is reading from
I have a C++ program that is reading in info from a file, that
I have DataReceviedHandler, that is reading the data from the Rx terminal. I will
From reading the Apple Docs on Core Data, I've learned that you should not
I do not think this is a duplicate. I have done some reading but
I am probably over analyzing here, but with all the reading I have done
I have a MySQL database that I am keeping temperature readings from several different
It's clear from reading through threads that I can call a PHP function using
From reading the RFC it appears that CID can/must only contain characters from the

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.