Why not use a language that doesn't have such problems in the first put (hint, any language that is not C or C++).
Why not use a language that doesn't have such problems in the first put (hint, any language that is not C or C++).