Well, take mike_g's suggestion and try
Code:
suma = (char *)bytes;
But consider this. That function always returns 0. I can prove it. Run this program, which passes every possible value to the function.
Code:
#include <stdio.h>
#include <limits.h>
int SumaDosNumerosPIC (char num1, char num2)
{
char *bytes;
char *suma;
unsigned char Estos_Bytes[3];
bytes =&Estos_Bytes[0];
suma = bytes;
Estos_Bytes[0]=0x00;
Estos_Bytes[1]=num1;
Estos_Bytes[2]=num2;
return ( (int) *suma);
}
int main() {
int x, y;
for(x = CHAR_MIN; x <= CHAR_MAX; x ++) {
for(y = CHAR_MIN; y <= CHAR_MAX; y ++) {
if(SumaDosNumerosPIC(x, y) != 0) {
printf("(%i,%i) != 0\n", x, y);
}
}
}
printf("I rest my case.\n");
return 0;
}
The only output is
which means that the function always returns 0.
The output is the same with or without casts, I should imagine.