Quote Originally Posted by cbpetro View Post
ok, I think understand. My problem was that I was operating under the assumption that the fread, fwrite functions were C++ specific since they are listed on a C++ reference site that I use and I thought they were safe.
When C++ was created, it was deemed advantageous to also inherit the 'C' standard library. The definitions of those 'C' functions remain the same, and that is where we get into problems.

The problem is that unlike 'C', C++ has two basic types, POD and non-POD types. 'C' only has POD types, so there is no issue using functions such as fwrite and fread for anything you want with little to no issue. However for C++, you need to know that what you can do with a 'C' or 'C'-compatible type (a POD type) cannot be done on a C++ type (one that contains virtual functions, for example).

So is the v-table used by C++ only?
Yes. There is no such thing as virtual functions in C. You can mimic what virtual functions do in 'C' (not trivial), but on a language level, there are no virtual functions in 'C', so no v-tables.

Regards,

Paul McKenzie