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数据库中有一个tablename表,设计如下 编号,书名,作者,出版时间,出版社,ISBN,目录,简介 其中除“编号”为自动编号外,其它都为“备注” 其中"编号"维一,在“ISBN”中有的为空值, ......
VB.NET code: Public Class excelAccess Public Function exceltoTb(ByVal strExcelFileName As String, ByVal strSheetName As String) As System.Data.DataTable Dim cnnStr As String = " ......
using(OleDbConnection conn = new OleDbConnection(Properties.Settings.Default.urlRecordConnectionString)) { try { ......
大家帮忙一下ADO连接上了数据库,但是我操作的时候就会错误,不知道为什么,比如我声明了 _RecordsetPt m_pRecordset;来操作m_pRecordset->adoEOF就会出错,不知道为什么,只要用到m_pRecordset这个指针就会 ......