I saw some post about implement GC in C and some people said it\'s impossible to do it because C is weakly typed. I want to know how to implement GC in C++.
The claim you saw is false; the Boehm collector supports C and C++. I suggest reading the Boehm collector's documentation (particularly this page)for a good overview of how one might write a garbage collector in C or C++.