#include <stdio.h>
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned long uint32_t;
typedef signed char int8_t;
typedef signed short int16_t;
typedef signed long int32_t;
typedef void (*pfUartSend)(uint8_t *pbuf, uint16_t len);
pfUartSend pf_uart_send;
void Uart_SendBuf(uint8_t* pbuf , uint16_t len)
{
while(len != 0)
{
putchar(*pbuf);
pbuf++;
len--;
}
putchar('
');
}
void main(void)
{
pf_uart_send = Uart_SendBuf;
(*pf_uart_send)("what the problem", 16);
pf_uart_send("what the problem", 16);
}
在上面这段代码中,两种调用都可以实现相同的打印结果。但是问题就来了,按照我以前的认知,pf_uart_send("what the problem", 16); 这条语句不应该会报错吗?想不通,有没有前辈帮忙分析分析?
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
一周热门 更多>