access violation问题 - VC/MFC / 基础类
大家好阿,我有一个类 class CItem { public: char itemName[20][100]; CItem(); }; CItem::CItem() { memset(itemName,0x00,sizeof(itemName)); } CItem* items[20]={NULL}; items[0]=new CItem(); 有一个Cstring对象itemInLine,然后我尝试向items[0]所指向到那个对象的itemName里拷贝字符串 CItem* ptrToItem; ptrToItem=items[0]; strcpy((ptrToItem->itemName[index]),itemInLine.GetBuffer(0)); strcpy那句提示access violation了,求高人指点,谢谢
itemInLine.GetBuffer(0))-->itemInLine.GetBuffer(itemInLine.GetLength()+1) index是多少啊?引用 index是多少啊? 抱歉,忘记写了,index是0 index 可能使数组越界了, index的值是多少?.引用 index 可能使数组越界了, index的值是多少?. index是0~~~ 额。。。那就麻烦大家的眼睛了 class CItem { public: char* type; int left; int top; char* style; int lineIndex; int columnIndex; int totalItem; int len[20]; int count[20]; char itemName[20][100]; char item[20][100]; char toPrint[50][46]; CItem(); }; CItem::CItem() { type=NULL; left=8; top=0; style=NULL; lineIndex=0; columnIndex=0; totalItem=0; memset(toPrint,0x20
相关问答:
错误提示: Error creating bean with name 'DAOProxy' defined in class path resource [appcontext.xml]: Cannot resolve reference to bean 'transactionManager' while setting bean property 'transactionMana ......
下面是数据 ID Money PID 1 50 2 40 1 3 30 1 4 ......
VS2008中C#操作Access数据库,网上下载了一个类,可以正常连接,读取数据,但是插入删除操作似乎有问题,以下是部分代码: 数据库类: namespace AccessDb { public class AccessDbClass { ......
我这里有一个score.mdb的access数据库。里面有课程、姓名、学号、成绩四项。我想通过VC连接access数据库,并在VC中得到0-59、60-69、70-79、80-89、90-100这几个分数段的人数和总人数。谁能帮忙。本人菜鸟。希望详细 ......
提示错误 :请尝试执行下列操作: 单击刷新按钮,或稍后重试。 打开 localhost 主页,然后查找与所需信息相关的链接。 HTTP 错误 500.100 - 内部服务器错误 - ASP 错误 Internet 信息服务 ------------- ......