How to alphabetically sort strings?

You could use std::set or std::multiset (if you will allow repeated items) of strings, and it will keep the items sorted automatically (you could even change the sorting criteria if you want). input: Gerardo Carlos Kamilo Angel Bosco output:

The program can’t start because libgcc_s_dw2-1.dll is missing

I believe this is a MinGW/gcc compiler issue, rather than a Microsoft Visual Studio setup. The libgcc_s_dw2-1.dll should be in the compiler’s bin directory. You can add this directory to your PATH environment variable for runtime linking, or you can avoid the problem by adding “-static-libgcc -static-libstdc++” to your compiler flags. If you plan to distribute the … Read more

Where to place native DLL to use Pocket PC emulator?

Suppose you have these two projects in the same Visual Studio solution: SmartDeviceProject1: the Pocket PC device application in C#. NativeDLL: the Win32 SmartDevice DLL in C++. Now you can follow the following steps: Select the Pocket PC Emulator for both project, in the Visual Studio Device Option. Deploy the projects; now in \\Program Files of your Emulator you … Read more

What is object slicing?

“Slicing” is where you assign an object of a derived class to an instance of a base class, thereby losing part of the information – some of it is “sliced” away. For example, So an object of type B has two data members, foo and bar. Then if you were to write this: Then the information in b about member bar is lost in a.

What is the difference between .cc and .cpp file suffix?

Conventions. Historically, the suffix for a C++ source file was .C. This caused a few problems the first time C++ was ported to a system where case wasn’t significant in the filename. Different users adopted different solutions: .cc, .cpp, .cxx and possibly others. Today, outside of the Unix world, it’s mostly .cpp. Unix seems to use .cc more often. For headers, the situation … Read more

C++ – Assigning null to a std::string

I can’t assign a null to a String? No. std::string is not a pointer type; it cannot be made “null.” It cannot represent the absence of a value, which is what a null pointer is used to represent. It can be made empty, by assigning an empty string to it (s = “” or s = std::string()) or by clearing … Read more

Static linking vs dynamic linking

Dynamic linking can reduce total resource consumption (if more than one process shares the same library (including the version in “the same”, of course)). I believe this is the argument that drives it its presence in most environments. Here “resources” includes disk space, RAM, and cache space. Of course, if your dynamic linker is insufficiently flexible there is … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)