i have func() which must have to take unsigned int parameter.
there is a reason for void func(unsigned int val),
i have to pass various type(unsigned char, unsigned short, unsigned int) to func parameter.
and i have to pass char array to func(), my current solution like below code.
Edit: is there easy way to port this code in 64bit platform?
char test_str[128] = { 0 };
void func(unsigned int val)
{
memcpy(test_str, (char *)val, 128); //current my solution
printf("%s\n", test_str);
}
int main()
{
char str[128] = "hello world";
func((unsigned int)(char *)&str); //current my solution
return 0;
}
note: intptr_t