That was my impression (that it was valid). Problem is that it accesses the data rather than the address of the data. &buff2[2] and buff[2] are equivalent... and I did not think they should be... I very much did not think they should be... bug in the compiler?
Thanks for the post.
How do I do this guys....
char *buff2 = " "; // is malloc'd in real code.
sprintf(&buff2[2],"xx"); // is sprintf(&buff2[2],"%02X",*ptr) in real code.
printf("%s\n");
obviously trying to write "xx" to &buff2+2 and &buff2+3.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.