typedef function with void parameters
- From: William Xu <william.xwl@xxxxxxxxx>
- Date: Thu, 13 Dec 2007 23:31:42 +0900
This won't compile:
,----
| int foo(char *p)
| {}
|
| int main(int argc, char *argv[])
| {
| typedef int (*FUNC)(void *);
|
| FUNC f = foo;
| }
`----
The error is:
,----
| gcc -O2 /Users/william/studio/helloworlds/foo.cpp -lm -o foo
| /Users/william/studio/helloworlds/foo.cpp: In function 'int main(int, char**)':
| /Users/william/studio/helloworlds/foo.cpp:26: error: invalid conversion from 'int (*)(char*)' to 'int (*)(void*)'
`----
--
William
http://williamxu.net9.org
.
- Follow-Ups:
- Re: typedef function with void parameters
- From: Tomás Ó hÉilidhe
- Re: typedef function with void parameters
- From: jameskuyper
- Re: typedef function with void parameters
- From: Chris Dollin
- Re: typedef function with void parameters
- Prev by Date: Re: Help me, a friend of mine wrote a program in C# and I wrote the same program in C..His is faster than mine on the same machine...How Come ?
- Next by Date: Re: Help me, a friend of mine wrote a program in C# and I wrote the same program in C..His is faster than mine on the same machine...How Come ?
- Previous by thread: this is a test
- Next by thread: Re: typedef function with void parameters
- Index(es):
Relevant Pages
|