Course Content

  • pointertofunction
  • pointerasarguments

Course Content


h> int* larger(int*, int*); void main() { int a = 15; int b = 92; int *p; p = larger(&a, &b); printf("%d is larger",*p); } int* larger(int *x, int *y) { if(*x > *y) return x; else return y; } type (*pointer-name)(parameter);

You can use pointers to call functions and send functions to other functions as arguments. On pointers to functions, you can't do pointer arithmetic.

When giving arguments to a function, the call by pointer method converts the address of an argument into the formal parameter. The address is utilised within the function to obtain the actual parameter used in the call. Changes to the parameter have an impact on the passed argument.

Like conventional pointers, function pointers point to code. The name of the function can be used to get the address of the function in Functions Pointers. A function can also be returned from a function and supplied as an argument.

We shall not allocate or deallocate memory since it is used to execute a block of code.

Recommended Courses

Share With Friend

Have a friend to whom you would want to share this course?

Download LearnVern App

App Preview Image
App QR Code Image
Code Scan or Download the app
Google Play Store
Apple App Store
598K+ Downloads
App Download Section Circle 1
4.57 Avg. Ratings
App Download Section Circle 2
15K+ Reviews
App Download Section Circle 3
  • Learn anywhere on the go
  • Get regular updates about your enrolled or new courses
  • Share content with your friends
  • Evaluate your progress through practice tests
  • No internet connection needed
  • Enroll for the webinar and join at the time of the webinar from anywhere