Exforsys

Free Training

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 ...

Go Back   Exforsys > Programming Talk > C and C++

Exforsys.com


C and C++ C and C++

Reply

 

LinkBack Thread Tools Search this Thread
  #1 (permalink)  
Old 03-26-2007, 03:37 PM
Senior Member
 
Join Date: Apr 2006
Posts: 144
caradoc is on a distinguished road
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?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 04-25-2007, 10:57 AM
Senior Member
 
Join Date: Apr 2006
Posts: 162
sammy is on a distinguished road
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-25-2007, 11:32 AM
Senior Member
 
Join Date: Apr 2006
Posts: 125
ashlee is on a distinguished road
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');
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
comp.lang.c Answers (Abridged) to Frequently Asked Questions (FAQ) Steve Summit Tech FAQ 0 06-15-2004 06:00 AM
comp.lang.c Answers (Abridged) to Frequently Asked Questions (FAQ) Steve Summit Tech FAQ 0 06-01-2004 06:01 AM
comp.lang.c FAQ list Table of Contents Steve Summit Tech FAQ 0 06-01-2004 06:00 AM
comp.lang.c Answers to Frequently Asked Questions (FAQ List) Steve Summit Tech FAQ 0 06-01-2004 06:00 AM
comp.lang.c Answers (Abridged) to Frequently Asked Questions (FAQ) Steve Summit Tech FAQ 0 05-15-2004 06:00 AM


All times are GMT -4. The time now is 09:13 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0
Copyright 2004 - 2009 Exforsys Inc. All rights reserved.