How to get the size of an array in C++?
The answer is using the sizeof operator. The important thing is that sizeof always returns the number of bytes of the operand regardless it is an array or a basic […]
The answer is using the sizeof operator. The important thing is that sizeof always returns the number of bytes of the operand regardless it is an array or a basic […]
We know an ordinary member function can not be defined multiple times. Suppose you have the following 3 files a.h, a.cpp, and main.cpp: //a.h #ifndef A_H #define A_H #include <iostream> […]
You can call a function of the debugged inferior in GDB CLI. Suppose you have a program: #include <stdio.h> void sayhi() { printf(“hi\n”); } int main() { printf(“hello world\n”); sayhi(); […]
You may think all the optimisations are turned off thoroughly if you do not provide the -O option for gcc. But according to this post, if you do not give […]
You’re so lucky to visit my yet another Makefile tutorial because there are so many tutorials about Makefile on the Internet that it is almost impossible for my post to […]
I often see people use #if and #ifdef interchangeably. #if MYMACRO … #else … #endif #ifdef MYMACRO … #else … #endif They seem to achieve the same result. If […]
If you are compiling code that use old openssl lib(such as openssl 1.0.2) with the latest openssl lib such as openssl 1.1.0, you will meet this error: invalid use of […]
When compiling with Mingw 32bit, the size of long and unsigned long is 4 bytes, the size of long long and unsigned long long is 8 bytes. To print a […]
If you use openssl RSA API to encrypt/decrypt/sign/verify, you will need a MODULUS, which is part of a RSA public key. To generate a MODULUS, first you need to generate […]
The examples of declaration in C++: int i; int i=0; extern int i; int fun(); int fun(){ return 1;} class A; class A { int a; void fun(); }; The […]