C / C++

Do you remember the first time you ever started to talk, when you are a kid ?

When we are kids and just started to talk, we can’t make bigger sentences all at once, we start small with little “words” before we grew up to make longer sentences.

Same goes with learning any computer programming language,

The architects of the programming language will reserve a set of words and assign those words with a special meaning in the language while creating it.

These words are called as “Keywords” (sometimes also as “reserved words”).

Let’s have a look at these before we start learning the language.

we don’t need to try to remember all these keywords at this moment, we will go through them one by one as we progress.

C programming language has 32 keywords in it:

auto
double
int
struct
break
else
long
switch
case
enum
register
typedef
char
extern
return
union
const
float
short
unsigned
continue
for
signed
void
default
goto
sizeof
volatile
do
if
static
while

C++ programming has another  31 keywords in it, in addition to the 32 keywords from acquired from C, so in total its 63 keywords !.

Below the table containing additional 31 keywords of C++:

asm
bool
catch
class
const_cast
delete
dynamic_cast
explicit
export
false
friend
inline
mutable
namespace
new
operator
private
protected
public
reinterpret_cast
static_cast
template
this
throw
true
try
typeid
typename
using
virtual
wchat_t

Points to remember:

  1. Keywords are case sensitive, meaning ‘auto‘ is keyword where ‘Auto‘ is not a keyword.
  2. Keywords cannot be used as names of variables, functions, classes or any user defined names.
  3. Compilers (like gcc, g++, turbo C, clang etc.,) can add additional Keywords specific to the compiler.