|
-
November 16th, 2010, 11:29 AM
#6
Re: typedef a function question
You can also have references to functions too.
Code:
typedef int (&Function)(int, double);
This has the disadvantage over pointers in that the reference cannot be reseated like a pointer can, nor can it be NULL, but if you never need pass in a NULL or need to reseat the pointer then use a reference instead.
Get Microsoft Visual C++ Express here or CodeBlocks here.
Get STLFilt here to radically improve error messages when using the STL.
Get these two can't live without C++ libraries, BOOST here and Loki here.
Check your code with the Comeau Compiler and FlexeLint for standards compliance and some subtle errors.
Always use [code] code tags [/code] to make code legible and preserve indentation.
Do not ask for help writing destructive software such as viruses, gamehacks, keyloggers and the suchlike.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|