0

how can i convert a void array to unsigned char array?
could you plz give a little sample?

3
Contributors
2
Replies
3
Views
10 Years
Discussion Span
Last Post by ssharish2005
0

could not understand your question. Did you declared a void pointer and then allocated memory? I mean if you could post some code snippet what you want to do, i can try to answer.

0
#include <stdio.h>
void foo(void *);
int main()
{
    char str[] = "This is a tes";
    
    foo(str);
    
    getchar();
    return 0;
}
void foo(void *str)
{
     printf("%s",(char*)str);
}
/* my output
This is a tes
*/

ssharish2005

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.