Practical, Pragmatic, C++
RSS icon Email icon Home icon
  • TCHAR in new C++ programs

    Posted on May 3rd, 2009 wozname 1 comment

    Wheres the beginning C++ 4 article?

    I have been debating with myself whether I should use TCHAR in my C++ examples in this blog.
    When you generate a new C++ console project in Visual Studio 2008, it automatically includes
    TCHAR and friends. I think this would be a bit confusing for the beginner who is trying to learn
    C++ for the first time. The approach that I think I’m going to take, is to delete all the generated
    files and let the beginner build his first program up from scratch in a new file using only standard
    types.

    First a review of the standard C++ char types

    A null terminated string is an array of chars with a null (0) character at the end
    to signal the end of the string. It is usually referred to with a char* pointer to the
    first letter in the string. Alternatively it can be embedded in a std::string or std::vector
    which is safer.

    Read the rest of this entry »