私のコードをコンパイルするときにサイズへのパスの無効なアプリケーションを取得していますが、自分で問題を見つけることができません。誰か助けてもらえますか?
/*********************************************************
* 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));
助けてくれてありがとう