Click here to Skip to main content
15,888,454 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi Friends,
I was actually lerning some new stuffs in Visual C++ and I come across a code in one of the file.
C++
typedef void (__cdecl *_PVFV)(void);

I understand that the code is MSVC++ specific and I have to look at some good book but for the time being, can you please provide me with a satisfactory answer about what the _PVFV is? I also have looked at _PIFV... Please help me regarding this.... I will be vey much thank ful to you.

With Regards
Tushar Srivastava
Posted
Comments
pasztorpisti 8-Sep-13 5:54am    
Learning C by reading the runtime library (that has hell ugly and often platform specific source code) is not a good idea. Actually this piece of code is not MSVC specific at all.

This is a function pointer declaration. typedef void (*_PVFV)(void); defines _PVFV as a function pointer type. The __cdecl keyword is there to define the calling convention of the function to use C calling convention[^].
 
Share this answer
 
v2
Comments
H.Brydon 8-Sep-13 17:24pm    
(+5)

Your url seems to be truncated. Perhaps you meant http://en.wikipedia.org/wiki/Calling_convention (?)

Another link that might be better is http://en.wikipedia.org/wiki/X86_calling_conventions

Also:
http://msdn.microsoft.com/en-us/library/zxk0tw93%28vs.71%29.aspx
http://msdn.microsoft.com/en-us/library/984x0h58%28v=vs.71%29.aspx
pasztorpisti 9-Sep-13 4:48am    
Thank you! The link was indeed truncated but your additional links are better anyway. A virtual +5. :-)
CPallini 9-Sep-13 5:10am    
5.
pasztorpisti 9-Sep-13 5:31am    
Thank you!
Er. Tushar Srivastava 10-Sep-13 6:53am    
My Question actually was, What is _PVFV and _PIFV :) Thank you for the reply by the way :)
Function pointer typedefs may look a bit 'esoteric'. You may find interesting this Stack Overflow question: "Understanding typedefs for function pointers in C: Examples, hints and tips, please"[^]
 
Share this answer
 
Comments
pasztorpisti 9-Sep-13 5:32am    
+5 Exactly. One of the cases where the typedef must be read starting from the middle.
CPallini 9-Sep-13 5:36am    
Thank you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900