- Expand Menus ↓
- 1 Introduction
- 2 Compiler & Installation
- 3 Program Structure
- 4 Data Types
- 5 Reserved Keywords
- 6 Basic Operators
- 7 I/O Functions
- 22 Function Declaration
- 23 Function Calling & Arguments
- 24 Local or Global Function
- 25 Storage Classes
Structure and Unions
- 26 C Structure & Union
- 27 Structure Declaration
- 28 Union Declaration
- 29 C enum
- 30 C typedef
- 31 sizeof() Operator
* Before learning the C language compiler installation process, you must clear a basic concept about assembler, compiler & interpreter.
An assembler, compiler, and interpreter are all tools used in the field of computer programming and software development to facilitate the process of converting high-level programming code into machine code or executing it. Each of these tools serves a different purpose and operates in a distinct way.
Installation of C Compiler
To install a C compiler on your computer, you will need to choose a specific C compiler based on your operating system. The two most commonly used C compilers are GCC (GNU Compiler Collection) and Code::Blocks. Here are instructions for installing these compilers on different operating systems:
1. Installing GCC:
Most Linux distributions come with GCC pre-installed. To check if it's installed, open a terminal and run the following command:
If GCC is not installed, you can install it using your package manager. For example, on Ubuntu or Debian-based systems, you can use:
sudo apt-get update sudo apt-get install gcc
macOS doesn't come with GCC pre-installed, but you can install it using the Homebrew package manager. First, install Homebrew if you haven't already by following the instructions at https://brew.sh/. Then, run the following command to install GCC:
brew install gcc
You can install GCC on Windows using the Windows Subsystem for Linux (WSL). First, install WSL following the Microsoft documentation (https://docs.microsoft.com/en-us/windows/wsl/install). After setting up WSL, you can use the Linux package manager to install GCC, just like you would on a Linux system.
Still, You can also try this one-line command (In administrator mode) for a quick installation process:
wsl --install -d ubuntu
Code::Blocks is an open-source & cross-platform integrated development environment (IDE) used for programming in various programming languages. It provides a user-friendly interface for writing, compiling, and debugging code. Code::Blocks is particularly popular among C and C++ developers, but it supports multiple programming languages and can be extended with plugins to support additional languages and functionality.
Compile the C File
To compile 'hello.c' using GCC, run the following command:
gcc hello.c -o hello
That's it! You've successfully compiled and run a C program from the command line. Remember to replace 'hello.c' and hello with your C source file's name and the desired output executable name.
Representations of Program
Source program, object program, and executable program are three stages or representations of a computer program during the software development process. Each serves a specific purpose and has distinct characteristics. Here's an explanation of the differences between them:
The set of instruction written in any one of the programming languages is called source program.
The translated or binary form of a source program is called an object program.
A program generated from object program by linking the input/output devices in order to execute th instructions given in a source program is called an executable program.
What is New?
We have just updated this website & still working on adding new content & updating existing features.