Sequence Points

A sequence point is any point in a program’s execution wherein all side effects of previous evaluations are complete and no side effects of subsequent evaluations have started. If you want, you can think of the semicolon at the end of each statement as a sequence point. A side effect is an action that changes [...]

Continue Reading...

Posted in C/C++ Programming Concepts

Incompatibilities Between ISO C and ISO C++

The 1989 C standard is known officially as ANSI/ISO 9899-1989, Programming Languages – C, and this document refers to the 1989 C standard as C89. The 1990 ISO revision of the standard is known officially as ISO/IEC 9899-1990, Programming Languages – C, which is referred to in this document as “C90″. The next version of [...]

Continue Reading...

Posted in C/C++ Programming Concepts, Comparisions

H264 Start Code Detection Logic

Here is code snippet for detecting the 3 byte (0×000001) or 4 bytes (0×00000001) h264 start code in a byte stream and getting the param size between nal start codes (basically this was written for parsing h264 param sets, so code is in that conext, however you can adopt it if you want). This can [...]

Continue Reading...

Posted in Algorithms, C++ Tidbits

Differences between C and C++ – Completed

The keyword typedef
The keyword typedef is in C++ allowed, but no longer necessary when it is used as a prefix in union, struct or enum definitions. This is illustrated in the following example:

struct somestruct
{
int a;
double d;
char string[80];
};

When a struct, union or other compound type is defined, the tag of this type can be used as [...]

Continue Reading...

Posted in Comparisions, Tutorials

Differences between C and C++ Continued…

The usage of standard C functions
Normal C functions, e.g., which are compiled and collected in a run-time library, can also be used in C++ programs. Such functions however must be declared as C functions. As an example, the following code fragment declares a function xmalloc() which is a C function:
extern "C" void *xmalloc(unsigned [...]

Continue Reading...

Posted in Comparisions, Miscellaneous, Tutorials