关于结构体内void型指针的初始化为0的结果
// An highlighted block
typedef struct UartSci_Driver_t
{
UART_Params params;
void* ptrDMAInfo;
UART_Stats stats;
}UartSci_Driver;
UartSci_Driver* ptrUartSciDriver;
memset ((void *)ptrUartSciDriver, 0, sizeof(UartSci_Driver));
则
ptrUartSciDriver->ptrDMAInfo = NULL;
// An highlighted block
typedef void* DMAInfoHandle;
typedef struct UartSci_Driver_t
{
UART_Params params;
DMAInfoHandle DMAInfo;
UART_Stats stats;
}UartSci_Driver;
UartSci_Driver* ptrUartSciDriver;
memset ((void *)ptrUartSciDriver, 0, sizeof(UartSci_Driver));
则
DMAInfoHandle ptrDMAInfo;
DMAInfoHandle* ptrDMAInfoHandle;
ptrDMAInfo = ptrUartSciDriver->DMAInfo = NULL;
ptrDMAInfoHandle = &ptrUartSciDriver->DMAInfo = NULL;