hi..
i've got a problem of assigning a variable of type Integer to another one of the same one.. i raise an unhandled exception.. but this doesn't happen in all cases i mean i've been trying to do the same kind of assigning statement but in a different part of the program it worked just fine.. i wonder what is it about..
here is a sample of the code that i've been using ( i'm using visual c++ verson 6 on windows 2000 proff.)
class CCoin
{
public:
CCoin();
public:
Integer A, B, zdash, adash, bdash, rdash, s, x1, x2, u, v;
virtual ~CCoin();
};
class CUser
{
public:
CCoin* coin;
Integer GenerateChallenge(CBank* bank, Integer a, Integer b, Integer& u, Integer& v)
};
Integer CUser::GenerateChallenge(CBank* bank, Integer a, Integer b, Integer& u, Integer& v)
{
// where A, B, adash.... etc are Integers and they are calculated in the body..*/
coin->A=A;
coin->adash=adash;
coin->B=B;
coin->bdash=bdash;
coin->zdash=zdash;
coin->s=s;
coin->x1=X1;
coin->x2=X2;
coin->u= u;
coin->v=v;
}
the error is " unhandled exception : Access violation"
and the debug reaches a part of the misc.h file where
void New(unsigned int newSize)
{
if (newSize != size)
{
T *newPtr = SecAlloc(T, newSize);
SecFree(ptr, size);
ptr = newPtr;
size = newSize;
}
}
where the size in red ( in the if condition) don't have any value..!!!
i hope someone can help me out thanks..
Soha..
MSN 8 helps ELIMINATE E-MAIL VIRUSES. Get 2 months FREE*.
