打印

c语言问题

[复制链接]
1529|2
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
areshan|  楼主 | 2010-8-25 11:03 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
#ifndef OSAL_TASKS_H
#define OSAL_TASKS_H
#ifdef __cplusplus
extern "C"
{
#endif
/*********************************************************************
* INCLUDES
*/
/*********************************************************************
* MACROS
*/
/*********************************************************************
* CONSTANTS
*/
#define TASK_NO_TASK      0xFF
/*********************************************************************
* TYPEDEFS
*/
/*
* Event handler function prototype
*/
typedef unsigned short (*pTaskEventHandlerFn)( unsigned char task_id, unsigned short event );
/*********************************************************************
* GLOBAL VARIABLES
*/
extern const pTaskEventHandlerFn tasksArr[];
extern const uint8 tasksCnt;
extern uint16 *tasksEvents;
/*********************************************************************
* FUNCTIONS
*/
/*
* Call each of the tasks initailization functions.
*/
extern void osalInitTasks( void );
/*********************************************************************
*********************************************************************/
#ifdef __cplusplus
}
#endif
#endif /* OSAL_TASKS_H */

高手帮我看看这种C的写法,我不知道什么意思:
1;extern "C"
     {

      } //上面的"C"是什么呢?
2;typedef unsigned short (*PTaskEventHandlerFn)(unsigned char task_id,unsigned short event);
//这句是用后面的指向函数指针类型来替换前面的unsigned short类型吗???

相关帖子

沙发
ayb_ice| | 2010-8-25 11:07 | 只看该作者
C++声明C程序里的东东

使用特权

评论回复
板凳
areshan|  楼主 | 2010-8-25 17:22 | 只看该作者
谢谢,明白了,extern "C"是在c++文件中加入c。
typedef unsigned short (*PTaskEventHandlerFn)(unsigned char task_id,unsigned short event);//这个是函数指针的类型定义,看看这句就知道了extern const pTaskEventHandlerFn tasksArr[];

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

127

主题

728

帖子

0

粉丝