¡@

Home 

c++ Programming Glossary: see

Why is processing a sorted array faster than an unsorted array?

http://stackoverflow.com/questions/11227809/why-is-processing-a-sorted-array-faster-than-an-unsorted-array

than an unsorted array Here is a piece of C code that seems very peculiar. For some strange reason sorting the data miraculously.. it is a branch instruction You are a processor and you see a branch. You have no idea which way it will go. What do you..

What is an undefined reference/unresolved external symbol error and how do I fix it?

http://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix

rules of translation is specified by the following phases see footnote . Physical source file characters are mapped in an.. or library that uses it . If you're using MSVS you'll see that projects generate .lib files. These contain a table of..

Do-While and if-else statements in C/C++ macros

http://stackoverflow.com/questions/154136/do-while-and-if-else-statements-in-c-c-macros

if else statements in C C macros In many C C macros I'm seeing the code of the macro wrapped in what seems like a meaningless.. C macros I'm seeing the code of the macro wrapped in what seems like a meaningless do while loop. Here are examples. #define.. do f X g X while 0 #define FOO X if 1 f X g X else I can't see what the do while is doing. Why not just write this without..

What uses are there for “placement new”?

http://stackoverflow.com/questions/222557/what-uses-are-there-for-placement-new

classes manually. For a good suggestion on this please see Stroustrup's FAQ on Is there a placement delete share improve..

What are the rules about using an underscore in a C++ identifier?

http://stackoverflow.com/questions/228783/what-are-the-rules-about-using-an-underscore-in-a-c-identifier

an MFC background you'll probably use m_foo . I've also seen myFoo occasionally. C# or possibly just .NET seems to recommend.. also seen myFoo occasionally. C# or possibly just .NET seems to recommend using just an underscore as in _foo . Is this.. headers is included unless explicitly stated otherwise see 7.1.4 . All identifiers with external linkage in any of the..

What is move semantics?

http://stackoverflow.com/questions/3106110/what-is-move-semantics

What is the copy-and-swap idiom?

http://stackoverflow.com/questions/3279543/what-is-the-copy-and-swap-idiom

1 get rid of the old data... delete mArray 2 mArray 0 2 see footnote for rationale ...and put in the new mSize other.mSize.. what if my class manages more than one While this may seem to be a valid concern and indeed it requires non trivial try..

What can I use to profile C++ code in Linux?

http://stackoverflow.com/questions/375913/what-can-i-use-to-profile-c-code-in-linux

is roughly the percentage of samples on which you will see it. There is no educated guesswork required. If you do have.. toy programs when actually it works on any program and it seems to work better on bigger programs because they tend to have.. a priori. Then suppose we take just 2 stack samples and we see instruction I on both samples designated observation o 2 2 ...

What are Aggregates and PODs and how/why are they special?

http://stackoverflow.com/questions/4178175/what-are-aggregates-and-pods-and-how-why-are-they-special

f ok just a private function You get the idea. Now let's see how aggregates are special. They unlike non aggregate classes.. the other n m elements are if possible value initialized see below for the explanation of the term else if m n the compiler.. int array 2 1 2 3 4 ERROR too many initializers Now let's see how aggregate classes can be initialized with braces. Pretty..

Operator overloading

http://stackoverflow.com/questions/4421706/operator-overloading

of operator should never be overloaded. For operator see this question . It's rarely used and thus rarely ever overloaded...

What are the barriers to understanding pointers and what can be done to overcome them?

http://stackoverflow.com/questions/5727/what-are-the-barriers-to-understanding-pointers-and-what-can-be-done-to-overcome

and rearrange the furniture at that house will make it seem that the other house has been modified in the same manner unless.. no longer there and goes to visit it with failed results see also the part about an invalid reference below . var h THouse.. 1234My house h v after free xx34My house As you can see h still points to the remnants of the data in memory but since..

C++ Singleton design pattern

http://stackoverflow.com/questions/1008019/c-singleton-design-pattern

design patterns singleton share improve this question See this article for a simple design for a lazy evaluated with guaranteed.. Don't Implement void operator S const Don't implement See this article about when to use a singleton not often Singleton.. use a singleton not often Singleton How should it be used See this two article about initialization order and how to cope..

What do the following phrases mean in C++: zero-, default- and value-initialization?

http://stackoverflow.com/questions/1613341/what-do-the-following-phrases-mean-in-c-zero-default-and-value-initializat

be the only difference that's more than a clarification . See Kirill V. Lyadvinsky's answer for the definitions straight from.. answer for the definitions straight from the standard. See this previous answer about the behavior of operator new for..

How to parse a string to an int in C++?

http://stackoverflow.com/questions/194465/how-to-parse-a-string-to-an-int-in-c

they will happily convert the string 11x to integer 11 . See more http en.cppreference.com w cpp string basic_string stol..

What are the rules about using an underscore in a C++ identifier?

http://stackoverflow.com/questions/228783/what-are-the-rules-about-using-an-underscore-in-a-c-identifier

letter may be used for additional error code names. See Error Reporting. Names that begin with either 'is' or 'to' followed..

Read whole ASCII file into C++ std::string

http://stackoverflow.com/questions/2602013/read-whole-ascii-file-into-c-stdstring

surprisingly inefficient Don't do this with large files. See http insanecoding.blogspot.com 2011 11 how to read in file in..

C++ Timer function to provide time in nano seconds

http://stackoverflow.com/questions/275004/c-timer-function-to-provide-time-in-nano-seconds

some dual core AMDs may also cause a problem . See the second post by sebbbi where he states QueryPerformanceCounter..

std::wstring VS std::string

http://stackoverflow.com/questions/402283/stdwstring-vs-stdstring

because each glyph is composed of one or two wchar_t . See MultiByteToWideChar and WideCharToMultiByte Win32 conversion.. Klingon Elvish while UTF 8 will spend from 1 to 4 bytes. See http en.wikipedia.org wiki UTF 8#Compared_to_UTF 16 for more..

In which scenario do I use a particular STL Container?

http://stackoverflow.com/questions/471432/in-which-scenario-do-i-use-a-particular-stl-container

a pretty good summary of the different containers. See the flowchart at the bottom as a guide on which to use in different..

What are the barriers to understanding pointers and what can be done to overcome them?

http://stackoverflow.com/questions/5727/what-are-the-barriers-to-understanding-pointers-and-what-can-be-done-to-overcome

work. This is a variation of the dangling pointer above. See its memory layout. Buffer overrun You move more stuff into the..

Difference between 'struct' and 'typedef struct' in C++?

http://stackoverflow.com/questions/612328/difference-between-struct-and-typedef-struct-in-c

is not hidden by another declaration with the same name. See Michael Burr's answer for the full details. share improve this..

Singleton: How should it be used

http://stackoverflow.com/questions/86582/singleton-how-should-it-be-used

pools C Singleton Limitation Single Threaded Design See http www.aristeia.com Papers DDJ_Jul_Aug_2004_revised.pdf For.. off how much you know Because everyone else is doing it See cargo cult programmer in wikipedia In user interface widgets..