What is an unsigned char?

In C++, there are three distinct character types: char signed char unsigned char If you are using character types for text, use the unqualified char: it is the type of character literals like ‘a’ or ‘0’ (in C++ only, in C their type is int) it is the type that makes up C strings like … Read more

C++ struct constructor

will try to initialise the array by calling a default constructor for node. You could either provide a default constructor or, rather verbosely, initialise all 100 elements explicitly or, since you’re using C++, use std::vector instead, appending to it (using push_back) at runtime

Regular cast vs. static_cast vs. dynamic_cast

static_cast `static_cast` is used for cases where you basically want to reverse an implicit conversion, with a few restrictions and additions. `static_cast` performs no runtime checks. This should be used if you know that you refer to an object of a specific type, and thus a check would be unnecessary. Example: In this example, you … Read more

What does “dereferencing” a pointer mean?

Reviewing the basic terminology It’s usually good enough – unless you’re programming assembly – to envisage a pointer containing a numeric memory address, with 1 referring to the second byte in the process’s memory, 2 the third, 3 the fourth and so on…. What happened to 0 and the first byte? Well, we’ll get to … Read more

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