Exforsys
+ Reply to Thread
Results 1 to 3 of 3

How to Call Function by this Concept

This is a discussion on How to Call Function by this Concept within the C and C++ forums, part of the Programming Talk category; I have learnt the concept of functions and pointers in C.I want to know whether it is possible to combine ...

  1. #1
    caradoc is offline Senior Member Array
    Join Date
    Apr 2006
    Answers
    122

    How to Call Function by this Concept

    I have learnt the concept of functions and pointers in C.I want to know whether it is possible to combine these concepts and call a function via pointers in C programming language. If so how can I do this?


  2. #2
    sammy is offline Senior Member Array
    Join Date
    Apr 2006
    Answers
    145
    In C you call a function using a function pointer by explicitly dereferencing it using the * operator. Alternatively you may also just use the function pointers instead of the function’s name.


  3. #3
    ashlee is offline Senior Member Array
    Join Date
    Apr 2006
    Answers
    108
    Yes as suggested by sammy you can use the concept of function pointers for calling a function using pointers in C programming language. I have given below a example to depict this usage.

    int test1 = exforsys (10, 'c', 'x');
    int test2 = (*exforsys) (10, 'c', 'x');


    •    Sponsored Ads



Latest Article

Network Security Risk Assessment and Measurement

Read More...