Skip to main content

Posts

Showing posts from March, 2022

Pointer and arrays in c programming

 You have probably heard this key word pointer and array  if you have been writing code for C programming or might have even heard it somewhere else from other programming languages like java and C++ and javascript but what exactly are they ?  A pointer is a variable which contains memory address Types and memory Every time you declare a variable, the computer will reserve memory for this variable. The memory reserved will then store the value of the variable. Depending on the type of the variable, the computer will reserve more or less memory. The size of each type is generally defined in bytes (1 byte = 8 bits, each bit being 0 or 1). The sizes of the types also depend on the computer you are using. Here are the sizes of the most common types on most 64-bit Linux machines: char -> 1 byte int -> 4 bytes float -> 4 bytes To determine the size of those types on your computer, you can use the  sizeof  operator.