LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-21-2006, 10:12 AM   #1
ArthurHuang
Member
 
Registered: Jan 2006
Posts: 174

Rep: Reputation: 30
typedef int fnct_ptr (void *)


what's the meaning of this sentense?

Thanks!
 
Old 08-21-2006, 10:27 AM   #2
xhi
Senior Member
 
Registered: Mar 2005
Location: USA::Pennsylvania
Distribution: Slackware
Posts: 1,065

Rep: Reputation: 45
> typedef int fnct_ptr (void *)

is it actually typedef int (*fnct_ptr)(void*);
which would be declaring funct_ptr as a type pointer to function that takes a void pointer and returns int.

ex.
Code:
#include <stdio.h>

typedef int (*fnct_ptr)(void*);

int test(void* p)
{
    printf("in test\n");
    return 1;
}

int main()
{
    fnct_ptr f = test;
    f(0);
    return 0;
}

Last edited by xhi; 08-21-2006 at 10:28 AM.
 
  


Reply


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with sending a signed int to another signed int. Almost random number given. RHLinuxGUY Programming 8 08-15-2006 11:38 AM
int * function(void)??? kalleanka Programming 5 08-01-2006 09:37 AM
[C] The FAR in typedef koyi Programming 2 07-21-2006 07:37 PM
invalid types int[int] for array subscript scuzzman Programming 2 11-16-2004 09:34 PM
void main(void) linuxanswer Programming 4 10-26-2003 12:37 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:17 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration