C is a type strict language. I am not responsible if you try to use a function built for C strings on an array of a different type. Which is the extent of your problem. In C, "4" is not 4. Resist your Pythonic background.Quote:
it works, but i need to know how to get ride of those errors before i can go any further. As i if i get a char array it will be fine, but it won't always be a char array
To calculate the size of a local array of some type sizeof a will work. If you think about it both the size of the pointer and the array's individual elements will be known at compile time. The exception is heap memory, where you will always end up with the size of a pointer (simply because that is how it is accessed). Then you have to do a run time calculation such as
length * sizeof( *p )
like what you did for malloc: p's net load on your RAM.

