首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

就几行代码为何报错内存不可写入,求修正解决方案

2012-05-13 
就几行代码为何报错内存不可写入,求修正C/C++ code#include stdio.htypedef struct VertNode{char Verte

就几行代码为何报错内存不可写入,求修正

C/C++ code
#include "stdio.h"typedef struct VertNode{    char VertexType;}VertNode;void main(){    VertNode *vertNode;    printf("请输入一个顶点类型字符:\n");    scanf("%s",&vertNode->VertexType);    }

为何报错内存不可写入,求修正

[解决办法]
VertNode *vertNode = (VertNode *)malloc(sizeof(VertNode));

热点排行
Bad Request.