Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

why function pointers and call back ?

Status
Not open for further replies.

bhadmanathan

Junior Member level 1
Junior Member level 1
Joined
May 7, 2016
Messages
18
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
187
I read the tutorial about function pointer. I understood the syntax and concept. But..


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
void A()
    {
        printf("HELLO");
    }
    void B(void (*p)())
    {
         p();
    }
    main()
    {
          B(A);      or       A();
    }



Instead of calling a function indirectly, we can simply call like A();

Is there anything in terms of memory....?



Thanks in advance
 
Last edited by a moderator:

Example widely used for data reception:
A is the callback function executed by an interruption.
B enable this interruption at the beginning.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top