Any pitfalls using char* instead of void* when writing cross platform code?
- by UberMongoose
Is there any pitfalls when using char*'s to write cross platform code that does memory access?
I'm working on a play memory allocator to better understand how to debug memmory issues. I have come to believe char*'s are preferable because of the ability to do pointer arithmetic and derefernce them over void*'s, is that true? Do the following assumptions always hold true on different common platforms?
sizeof(char) == 1
sizeof(char*) == sizeof(void*)
sizeof(char*) == sizeof(size_t)