When to use extern in C++

This comes in useful when you have global variables. You declare the existence of global variables in a header, so that each source file that includes the header knows about it, but you only need to “define” it once in one of your source files. To clarify, using extern int x; tells the compiler that … Read more

Python Variable Declaration

Okay, first things first. There is no such thing as “variable declaration” or “variable initialization” in Python. There is simply what we call “assignment”, but should probably just call “naming”. Assignment means “this name on the left-hand side now refers to the result of evaluating the right-hand side, regardless of what it referred to before … Read more