In C programming data types play a major role, so is their size and range. The
sizeof() operator gives you bytes required to store value of some type in memory. However, in programming you must be aware of range of a type to avoid overflow and underflow errors.
The size of a data type is compiler dependent and so is its range. So, you must not hardcode size and range values in your program.
There are two ways to find minimum and maximum range of a type. You can use any of the approach to get range of a type.
Continue reading How to find range of data types in C programming?
Size of a data type is machine dependent and vary from compiler to compiler. However, in programming there exists situations when we need to know total bytes a type occupies in memory. To find exact size of a type in C programming we use
sizeof() is a special operator used to find exact size of a type in memory. The
sizeof() operator returns an integer i.e. total bytes needed in memory to represent the type or value or expression.
sizeof() is much used operator by programmers. It is very useful for developing portable programs.
Continue reading sizeof() operator in C programming
main() is a special function in C programming language. Reasons that make it special are -
- It defines starting point of the program.
main is the first executed function.
- It controls all other child functions.
- Behaves as both user-defined and pre-defined function.
- Every software written in C must have a main function.
C is a popular programming language. There exist many compilers and standards for C. So exists many variants of
main function declaration. In this post we will learn various declarations of
main one by one. Later we will see the standard definition of the
main function in C.
Continue reading Various declarations of main() function in C
Compiling and executing C programs using command prompt has always been a nightmare to programmers. It is time taking process.
Once you got strong hold to compile and execute C programs using command line, it’s time to switch to IDE. However, I always recommend a beginner to use command prompt for sometime for compiling and executing C programs.
CodeBlocks is a powerful IDE for creating, compiling, executing and debugging C/C++ programs. In previous post, I explained installation and configuration of CodeBlocks. In this post we will move further and see how to create, compile and run a C program in CodeBlocks.
Continue reading How to create and run C program using CodeBlocks
This is one of the most frequently asked question to me. Creating and compiling a C program using an IDE is like waving some magic wand. However, a beginner must know how to compile and run C programs using command line in Windows based operating system.
To create a C program using command line you need two basic software’s.
- A text editor (such as Notepad or Notepad++ ).
- A C compiler.
Continue reading How to compile and run C program using command line in Windows
Programming in C is fun and interesting. In this entire series of C programming tutorial. You will create, edit, compile and execute many C programs. Before we begin to learn about C programs, you must configure your computer with C compiler.
To create and execute a C program you require minimum two software's.
- A text editor (such as Notepad, Notepad++, Gedit, TextEdit, Sublime etc.)
- A C compiler (Optionally CodeBlocks IDE).
In this post, I will discuss about C compiler and steps to setup C compiler along with CodeBlocks in your machine.
Continue reading Install and configure CodeBlocks with C compiler
We already learn't about low level and high level language. We have seen their advantages and their disadvantages. Let’s compare them on various grounds.
Continue reading Low level vs High level language – Difference between low and high level language
High level language is abbreviated as HLL. High level languages are similar to the human language. Unlike low level languages, high level languages are programmers friendly, easy to code, debug and maintain.
High level language provides higher level of abstraction from machine language. They do not interact directly with the hardware. Rather, they focus more on the complex arithmetic operations, optimal program efficiency and easiness in coding.
Continue reading High level languages – advantages and disadvantages
Low level language abbreviated as LLL, are languages close to the machine level instruction set. They provide less or no abstraction from the hardware. A low-level programming language interacts directly with the registers and memory. Since, instructions written in low level languages are machine dependent. Programs developed using low level languages are machine dependent and are not portable.
Continue reading Low level languages – advantages and disadvantages
Thousands of programming languages have been written till date. Each for some specific purpose. Some programming languages provide less or no abstraction from the hardware. Whereas some provide higher abstraction. To separate programming languages on the basis of level of abstraction from hardware, they are classified into various categories.
Continue reading Classification of programming languages