P
paulrc_25
I'm working with C++ Builder 5.0 Enterprise Edition, and I got this
message:
Project CntSch.exe raised exception class EAccessViolation with message
'Access violation at address 40004B66 in module VCL50.BPL...
____________________
My code is this:
// I define some types:
typedef AnsiString tipoEsquema;
struct tnodo {
tipoEsquema squema;
int cntEsq;
struct tnodo *siguiente;
};
typedef struct tnodo tipoNodo;
-----
// Then I try to use them in a code segment:
tipoEsquema *estosEsq =
(tipoEsquema*)malloc(cuantosEsq*sizeof(tipoEsquema));
lonCad = someConstant;
for (i = 0; i < cuantosEsq; i++)
// *** I got the message error in next line
estosEsq = AnsiString::StringOfChar('0',lonCad);
-----
/*
I commented the part of the code that calls that, and later in code, I try
this function:
*/
tipoNodo* creaNodo(tipoNodo *valor)
{
tipoNodo *nnodo = (tipoNodo *)malloc(sizeof(tipoNodo));
if (nnodo != NULL) {
// **** I got that error back here
nnodo->squema = valor->squema;
nnodo->cntEsq = valor->cntEsq;
nnodo->siguiente = NULL;
}
return nnodo;
}
----
I will appreciate any help.
Thanks
Paul RC
message:
Project CntSch.exe raised exception class EAccessViolation with message
'Access violation at address 40004B66 in module VCL50.BPL...
____________________
My code is this:
// I define some types:
typedef AnsiString tipoEsquema;
struct tnodo {
tipoEsquema squema;
int cntEsq;
struct tnodo *siguiente;
};
typedef struct tnodo tipoNodo;
-----
// Then I try to use them in a code segment:
tipoEsquema *estosEsq =
(tipoEsquema*)malloc(cuantosEsq*sizeof(tipoEsquema));
lonCad = someConstant;
for (i = 0; i < cuantosEsq; i++)
// *** I got the message error in next line
estosEsq = AnsiString::StringOfChar('0',lonCad);
-----
/*
I commented the part of the code that calls that, and later in code, I try
this function:
*/
tipoNodo* creaNodo(tipoNodo *valor)
{
tipoNodo *nnodo = (tipoNodo *)malloc(sizeof(tipoNodo));
if (nnodo != NULL) {
// **** I got that error back here
nnodo->squema = valor->squema;
nnodo->cntEsq = valor->cntEsq;
nnodo->siguiente = NULL;
}
return nnodo;
}
----
I will appreciate any help.
Thanks
Paul RC