我似乎无法读取双指针指向的数据。它用于分配,因为我必须使用双指针。
出现以下错误:
Error: Access violation reading location.
这是代码:
struct Fraction {
int num, denom;<br>
};
struct PolyTerm {
struct Fraction coeff;
int exponent;v
};
struct PolyNode {
struct PolyTerm** dataPtr;
struct PolyNode* next;
};
void printPolyTerm(struct PolyTerm** argTerm) { // this function works fine><br>
printFraction(&(argTerm->coeff)); //also works fine
printf(" X^%d", argTerm->expo);
return;
}
void printPolyNode(const PolyNode* node) { //NOT WORKING<br>
struct PolyTermPS** ppTerm = node->dataPtr;
struct PolyTermPS* pTerm = *ppTerm;
printPolyTerm(pTerm);
return;
}