or (HTML5)

nav is used for groups of internal links (a elements). Generally this means the links should travel to separate pages, or change content in the case of an AJAX page. Expect some sort of content change when clicking on a nav item. menu is used for groups of controls (a, input, button). Generally this means … Read more

When can you omit the file extension in an #include directive?

The C++ standard headers do not have a “.h” suffix. I believe the reason is that there were many, different pre-standard implementations that the standard would break. So instead of requiring that vendors change their exiting “iostream.h” (for example) header to be standards compliant (which would break their existing user’s code), the standards committee decided … Read more

Use CSS to automatically add ‘required field’ asterisk to form inputs

Is that what you had in mind? http://jsfiddle.net/erqrN/1/ <label class=”required”>Name:</label> <input type=”text”> <style> .required:after { content:” *”; color: red; } </style> .required:after { content:” *”; color: red; } <label class=”required”>Name:</label> <input type=”text”> See https://developer.mozilla.org/en-US/docs/Web/CSS/pseudo-elements

Is it unspecified behavior to compare pointers to different arrays for equality?

The semantics for op== and op!= explicitly say that the mapping is except for their truth-value result. So you need to look what is defined for their truth value result. If they say that the result is unspecified, then it is unspecified. If they define specific rules, then it is not. It says in particular … Read more

Why don’t the C or C++ standards explicitly define char as signed or unsigned?

Historical reasons, mostly. Expressions of type char are promoted to int in most contexts (because a lot of CPUs don’t have 8-bit arithmetic operations). On some systems, sign extension is the most efficient way to do this, which argues for making plain char signed. On the other hand, the EBCDIC character set has basic characters … Read more

What are declarations and declarators and how are their types interpreted by the standard?

I refer to the C++11 standard in this post Declarations Declarations of the type we’re concerned with are known as simple-declarations in the grammar of C++, which are of one of the following two forms (ยง7/1): decl-specifier-seqopt init-declarator-listopt ; attribute-specifier-seq decl-specifier-seqopt init-declarator-list ; The attribute-specifier-seq is a sequence of attributes ([[something]]) and/or alignment specifiers (alignas(something)). … Read more

tech