![]() ![]() ![]() It offers two varieties of each: a standard version and a cat_ version. For circumstances in which an old-style char*string is required, such as to pass a parameter to a Win32 API call, both stringclasses offer the c_str() member function, which returns such a string.In addition, the AnsiString class also offers the popular old-style sprintf() and printf() functions (for concatenating strings)as member functions. Otherwise, use AnsiString, which has the advantage that it is the stringrepresentation used throughout the VCL and, thus, allows your code to workseamlessly with the VCL. If portability across operating systems is a goal,you cannot use the VCL, so this is the string class to use. Access the C++ Standard Library'sstring class by including the statement #include Īt the top of your code. Use either the stringclass provided by the C++ Standard Library or the VCL's native string class AnsiString (which has been conveniently typedefed to String). Say goodbye to char* for string manipulation. The topicsdiscussed here are those that have particular relevance to C++Builder, and thosethat are often misunderstood or misused by those new to C++Builder. Entire books are devoted to better C++ programming, and you areencouraged to read such texts to deepen your understanding of C++. This section looks at some ways to improve how you write C++ code inC++Builder. Better Programming Practices in C++Builder Then, a brief discussion of the use of nonvisual components in C++Builderleads to an in-depth discussion of multithreading to wrap up this trip throughkey C++Builder programming practices. You will get a tripthrough all the important features, including screen layout techniques to createinterfaces that work well as the user changes the window's size, and how touse Actions to simplify user interface implementation. One of the core advantages of C++Builder is the visual developmentenvironment that you can use to build user interfaces. ![]() Next comes a quick trip through the most useful components on the componentpalette. This is followed by an overview of the VCL (Visual Component Library) thatprovides the rapid application development capability unique to C++Builder amongC++ development environments. Some of these differ from those used in pure C++programming, but they add to your productivity by leveraging the key advantagesof the C++Builder environment. This chapter begins with the programming practices that form the basis of C++Builder programming. This chapter assumes your basic understanding of the C++ languageand the C++Builder IDE as described in previous chapters. Better Programming Practices in C++BuilderĬ++Builder influences programming on many levels, and this chapter helps youto see how. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |