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
相关问答:
我用Access数据库做了一个图书数据库,里面有一个字段是ISBN,就是ISBN号,但是只的一总分图书写的ISBN号,有的没写,写的那一部分有的ISBN是重复的,能否用SQL语言把重复的过滤掉,但没写ISBN号的图书不能过滤掉,� ......
使用ACCESS最大的隐患就是不安全。今天对ACCESS数据库设置了一个密码,必须使用密码才能打开,但是在程序中却无法连接数据库了。大家知道使用用户名和密码,如何连接ACCESS数据库?貌似ACCESS的用户名还不知道?只知 ......
create view 表名 as select a.a1,b.b1 from a inner join b on a.id=b.id 这个语法怎么写上去是错的在Access里 ACCESS好像不支持create view 你可以在ACCESS中单击“视图”菜单,选择“SQL视图”命令, ......