找回密码
 注册
搜索
查看: 1110|回复: 2

[讨论] 函数指针为什么指向了结构体

[复制链接]
发表于 2011-1-26 14:55:45 | 显示全部楼层 |阅读模式
想看看gui_measure_string是怎样一流程,结果得到下面的信息

第一步: extern void (*gui_measure_string) (UI_string_type text, S32 *width, S32 *height);
第二步:/*----------------------------------------------------------------------------
Function Pointer: gui_measure_string
Description:      Returns the width and height of a string in pixels
Input Parameters: text  pointer to the string
Output Parameters:   width pointer to width of string in pixels
               height   pointer to height of string in pixels
Returns:       void
Remarks:       This works with reference to the current font.
               See gui_set_font()
----------------------------------------------------------------------------*/

第三步:然后找到gui_set_font
/*----------------------------------------------------------------------------
Function Pointer: gui_set_font
Description:      Sets the font to be used by text display functions
Input Parameters: f     is the font to be used
Output Parameters:   none
Returns:       void
Remarks:       See UI_font_type (Abstract type)
----------------------------------------------------------------------------*/
第四步:
typedef struct stFontAttribute
{
    U8 bold;
    U8 italic;
    U8 underline;
    U8 size;
    U8 color;
    U8 type;
    U8 oblique;
    U8 smallCaps;
} stFontAttribute;
typedef stFontAttribute*        UI_font_type;

请问:到最后不是指向了一个结构体吗?函数指针允许指向结构体?
发表于 2011-1-26 19:21:17 | 显示全部楼层
这位仁兄搜这个: gui_measure_string =
点评回复

使用道具 举报

 楼主| 发表于 2011-1-27 15:52:41 | 显示全部楼层
谢谢,,想多了
点评回复

使用道具 举报

高级模式
B Color Image Link Quote Code Smilies

本版积分规则

Archiver|手机版|小黑屋|52RD我爱研发网 ( 沪ICP备2022007804号-2 )

GMT+8, 2025-2-27 04:52 , Processed in 0.045467 second(s), 16 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表