#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "mystuff.h"
typedef struct Node
{
int size;
int status;
struct Node *next;
struct Node *previous;
} Node;
Node *endNode;
Node *rootNode;
void *my_foo(int size)
{
Node *theNode;
void *ptr;
if (rootNode->next == NULL)
{
theNode->status = 1;
...
它在“rootNode-> == NULL”处出现段错误,但如果我将其更改为“rootNode == NULL”,那么当它命中“theNode->status = 1”并将 theNode 和 rootNode 声明为 NULL 时会出现段错误并没有帮助。