C
cpptutor2000
Could some C guru please help me?
I have a function that takes as an argument a pointer to an array of
unsigned chars (basically a hex representation of a dotted decimal IP
address). When I print out the received values in the receiving
function, I get something completely different from what I passed in.
The following are the relevant code snippets:
In the calling function:
unsigned char* TempAddrs[] = {"0xC0", "0xA8", "0x00", "0x63"};
......
......
returnStatus = DoSomething(TempAddrs);
In the called function I have, right at the start:
printf("Received : %u %u %u %u ...\n", addr[0], addr[1], addr[2],
addr[3]);
I am sure there is a problem, but I am not sure what it is - thanks in
advance for your help.
I have a function that takes as an argument a pointer to an array of
unsigned chars (basically a hex representation of a dotted decimal IP
address). When I print out the received values in the receiving
function, I get something completely different from what I passed in.
The following are the relevant code snippets:
In the calling function:
unsigned char* TempAddrs[] = {"0xC0", "0xA8", "0x00", "0x63"};
......
......
returnStatus = DoSomething(TempAddrs);
In the called function I have, right at the start:
printf("Received : %u %u %u %u ...\n", addr[0], addr[1], addr[2],
addr[3]);
I am sure there is a problem, but I am not sure what it is - thanks in
advance for your help.