结构体的几个小问题
#include "stdafx.h"#include <stdlib.h>#include "conio.h"#include "math.h"#include <string.h>#define N 3struct node{ char *pname; //长度不限,动态分配内存};void main0(){ struct node *pnode; struct node *ptext[N]; struct node s[N]; pnode = s; int i; printf("input:\n"); for(i = 0; i < N; i++) { scanf("%s\n", pnode->pname); ptext[i] = pnode++; } printf("output:\n"); for(i = 0; i< N; i++) { printf("%s\n", ptext[i] ->pname); }}int _tmain(int argc, _TCHAR* argv[]){ main0(); system("pause"); return 0;}