What’s the difference between __PRETTY_FUNCTION__, __FUNCTION__, __func__?

__func__ is an implicitly declared identifier that expands to a character array variable containing the function name when it is used inside of a function. It was added to C in C99. From C99 §6.4.2.2/1: The identifier __func__ is implicitly declared by the translator as if, immediately following the opening brace of each function definition, … Read more

Coding Conventions – Naming Enums

Enums are classes and should follow the conventions for classes. Instances of an enum are constants and should follow the conventions for constants. So enum Fruit {APPLE, ORANGE, BANANA, PEAR}; There is no reason for writing FruitEnum any more than FruitClass. You are just wasting four (or five) characters that add no information. This approach … Read more

What is the standard naming convention for html/css ids and classes? [closed]

There isn’t one. I use underscores all the time, due to hyphens messing up the syntax highlighting of my text editor (Gedit), but that’s personal preference. I’ve seen all these conventions used all over the place. Use the one that you think is best – the one that looks nicest/easiest to read for you, as … Read more

Why aren’t variable-length arrays part of the C++ standard?

[*] (Background: I have some experience implementing C and C++ compilers.) Variable-length arrays in C99 were basically a misstep. In order to support VLAs, C99 had to make the following concessions to common sense: sizeof x is no longer always a compile-time constant; the compiler must sometimes generate code to evaluate a sizeof-expression at runtime. … Read more

Is there a W3C valid way to disable autocomplete in a HTML form?

Here is a good article from the MDC which explains the problems (and solutions) to form autocompletion. Microsoft has published something similar here, as well. To be honest, if this is something important to your users, ‘breaking’ standards in this way seems appropriate. For example, Amazon uses the ‘autocomplete’ attribute quite a bit, and it … Read more

What are the new features in C++17?

Language features: Templates and Generic Code Template argument deduction for class templates Like how functions deduce template arguments, now constructors can deduce the template arguments of the class http://wg21.link/p0433r2 http://wg21.link/p0620r0 http://wg21.link/p0512r0 template <auto> Represents a value of any (non-type template argument) type. Non-type template arguments fixes template<template<class…>typename bob> struct foo {} ( Folding + … … Read more

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

The rules (which did not change in C++11): Reserved in any scope, including for use as implementation macros: identifiers beginning with an underscore followed immediately by an uppercase letter identifiers containing adjacent underscores (or “double underscore”) Reserved in the global namespace: identifiers beginning with an underscore Also, everything in the std namespace is reserved. (You … Read more

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