No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.
struct tnode { int data; struct tnode* left; struct tnode* right; }; struct tnode*talloc(int data) { struct tnode*p=(struct tnode*) malloc(sizeof(struct tnode)) if (p!=NULL) { p->data=data; p->next=NULL; p->right=NULL; } return p; } int main(){} I am getting a [error: 'NULL' undeclared] error, Any help would be greatly appreciated. |
|
I'm currently doing MIT Opencourseware's Practical Programming in C. I'm finding pointers a little bit confusing. Here are some questions: 1) int *pa=arr Suppose char * pc = (char*)pa; what value of i satisfies (int *)(pc+i)== pa + 3? [Answer:i=12] I get that the address is 12 bits down because … |