thanks for your answers this is how the function looks now:
Code:
void XorEncode(char *password, int ipl, char *data, int dlength)
{
//char newdata[] = new char[dlength];
//int dlength = length(data);
//int ipl = length(password);
int ip = 0;
int i =0;
for (i=0; i < dlength; i++) {
data[i] = data[i] ^ password[ip] ;
ip++;
if (ip == ipl) ip = 0;
}
}
i was able to get the lengths of the 'pointer' before calling my own function. And yes length does not seem to be a valid c thing although the compiler did not complain about it but the linker did.
so i consider this solved.
Bookmarks