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
相关问答:
rt,我试了网上直连Acces数据库的方法,windows下没有问题,但是在linux下不行,谁能给点提示?谢谢 你怎么连的? Acces数据库.. 你怎么练的呢? Java code: static String DBDRIVER = "sun.jd ......
下面是数据 ID Money PID 1 50 2 40 1 3 30 1 4 ......
如何将一个ListBox中的数据存在数据库中的一个字段下面,并且每条记录的字符串个数不一定 以及如何从数据库中读取该ListBox中的所有记录 C/C++ code: //存入数据库 void __fastcall TForm1::Button5Click(TO ......
create view 表名 as select a.a1,b.b1 from a inner join b on a.id=b.id 这个语法怎么写上去是错的在Access里 ACCESS好像不支持create view 你可以在ACCESS中单击“视图”菜单,选择“SQL视图”命令, ......
using(OleDbConnection conn = new OleDbConnection(Properties.Settings.Default.urlRecordConnectionString)) { try { ......