我在编译我的代码时遇到一个无效的路径大小错误应用程序,但我自己找不到问题,有人可以帮忙吗?
/*********************************************************
* Node to represent a packet which includes a link reference*
* a link list of nodes with a pointer to a packet Struct *
**********************************************************/
struct node {
unsigned int Source;
unsigned int Destination;
unsigned int Type;
int Port;
char *Data;
struct Packet *next;
// Link to next packet
//unassigned int source
//unassigned int destination
//int type
//unassigned int port
//char *data
//struct node *next link to next node
};
typedef struct Packet node; // Removes the need to constantly refer to struct
/*********************************************************
* Stubs to fully declared functions below *
**********************************************************/
void Outpacket(node **head);
void push(node **head, node **aPacket);
node* pop(node **head);
int main() {
/*********************************************************
* pointers for the link list and the temporary packeyt to *
* insert into the list *
**********************************************************/
node *pPacket, *phead = NULL;
/*********************************************************
* Create a packet and also check the HEAP had room for it *
**********************************************************/
pPacket = (node *)malloc(sizeof(node));
if (pPacket == NULL)
{
printf("Error: Out of Memory\n");
exit(1);
}
这只是完整代码的片段,但断点发生在以下行:
pPacket = (node *)malloc(sizeof(node));
谢谢你的帮助