Announcement for my up-coming course on C programming
Sandip Bhattacharya - Upcoming course on Programming with C

Announcement for my up-coming course on C programming

Hello, my friends,

I hope you're enjoying my Android, OOP and jQuery courses so far.

Now, I have a really big announcement to make. Hopefully, within August or early September, a new Course is getting published on C programming which includes the following:

  • Getting Started with C
  • Data types, Operators and Expressions in C
  • Decision Making in C
  • Loops in C
  • Arrays in C
  • Strings in C
  • Functions in C
  • Storage class in C
  • Pointers in C
  • Structure, Union, Enum in C
  • File handling in C
  • Useful library functions in C

In this course, I will share my 13 years of C programming and teaching experience in a completely hands-on style with clear, compelling content, accurate, relevant information, and in-depth knowledge.

I am super excited to share this course with you all. If you have any suggestions on improving this C course even better, pls comment below. Here's a quick pick on Chapter 1: Getting Started with C.

History of C

Before we write high-performance programs in C, it would be interesting to find out what is C, it’s origin and how does it compare with other computer languages. C was invented and first implemented by Dennis Ritchie on a DEC PDP-11 that used the Unix operating system at AT&T’s Bell Laboratories of USA in 1972. Dennis Ritchie is known as the founder of the C language. C is the result of a development process that started with an older language called BCPL. BCPL was developed by Martin Richards, and it influenced a language called B, which was invented by Ken Thompson. B led to the development of C.

Let's see the programming languages that were developed before the C language.

C is a Middle-Level Language

C is most of the time called a middle-level computer language because it combines the best features of high-level languages with the control and flexibility of assembly language. It can be used to do System Programming for writing an operating system as well as Application Programming for writing a menu-driven customer billing system for example. That's why it is called a middle-level language. C code is also very portable that means it is easy to adapt software written for one type of computer or operating system to another type. For example, you can easily convert a program written for Windows and run under Mac or Linux. Examples of different types of languages are shown below:

High level - Ada, Modula-2, Pascal, COBOL, FORTRAN, BASIC

Middle level - Java, C++, C, FORTH, Macro-assemble

Low level – Assembler

C is a Structured Language

C is called a structured programming language because to solve a large problem, C programming language divides the problem into smaller modules called functions or procedures each of which handles a particular responsibility. The program which solves the entire problem is a collection of such functions. Here is an example of calculating a student's grade. Program is divided into these sub-modules - input student marks, get student record, update student record, display student record, calculate the grade. Here is a structural view of the program.


Compilers vs. Interpreters

An interpreter reads the source code of your program one line at a time, performing the specific instructions contained in that line. In languages such as Java or C++, a program's source code is first converted into an intermediary form that is then interpreted. A compiler reads the entire program and converts it into object code, which is a translation of the program's source code into a form that the computer can execute directly. Object code is also referred to as binary code or machine code. Once the program is compiled, a line of source code is no longer meaningful in the execution of your program.

You should know that programs written in any computer language can be compiled or interpreted, some languages are designed more for one form of execution than the other. For example, Java was designed to be interpreted, and C or C++ was designed to be compiled. Therefore, you will almost always be using a C compiler when developing your C programs.

The Form of a C Program

Communicating with a computer involves speaking the language it understands. This is similar to learning the English language and learning C language. The classical method of learning English is to first learn the alphabets used in the language, then learn to combine these alphabets to form words, which in turn are combined to form sentences and sentences are combined to form paragraphs. Learning C is similar and easier. Instead of straight-away learning how to write programs, we must first know what alphabets, numbers and special symbols are C made up with, then how using them constants, variables and keywords are constructed, and finally how are these combined to form an instruction. A group of instructions is combined to write a program.

Constants, Variables, and Keywords

Alphabets, numbers and special symbols like underscore are combined to form constants, variables, and keywords. A constant as the name indicates is an entity that doesn’t change. We can classify the constants into integer constants, floating-point or real constants and character constants. An integer constant is a whole number like 1, 123, 21000 or -234. The real constants are the numbers with the decimal value like 30.026 or 100.04 etc. A character constant is a single alphabet or digit or a special symbol written in the single quotes. For example ‘a’, ‘z’, ‘=’ or ‘9’.

A variable as the name indicates is an entity that may change during program execution. In any program, we typically do lots of calculations. And these results are stored in computer memory.

Let’s discuss the keywords. By using these keywords we can construct meaningful statements in any language. Every language has its own set of keywords. These are the words whose meaning has already been explained to the compiler. For example, in C we use the keywords like a break, continue, for, if, int, etc. But one thing we should note is keywords can not be used as variable or function name. if you do that you’ll get an error.

There are 32 keywords available in ANSI C. A detailed discussion of each of these keywords will be given in later lectures.

Along with these keywords, C supports other numerous keywords depending upon the compiler vendors like Microsoft, Intel, Borland or GNU GCC.

Your First C Program

We are going to print “Hello World” on the console. Open your favorite code editor, CodeBlocks IDE in my case. Go to File > New > Empty file. The shortcut is CTRL+SHIFT+N. Save the file anywhere by pressing CTRL+S. I’ll name it “Hello World.c”. Press Save. If you do not add the extension .c then the compiler will not recognize it as a C language program file. Write:

/*

Description: Print Hello World on the screen

Author: Sandip

Date: 04/08/2019

*/

#include<stdio.h>

int main()

{

    //Print something and then a newline

    printf(“Hello World\n”);

    return 0;

}

You'll find every detail about Pre-processor, Header file, main() function, printf(“Hello World\n”), Escape Sequence, Comments, Indentation, Case sensitivity, Your Second C Program for calculating simple interest, Your Third C Program with user input using scanf(), Difference between C, C++ and Java and much more in only the first chapter. So, you can guess what you'll get from the whole course. If you're curious about getting more updates about this course, subscribe to my YouTube channel here

Have a great weekend!

Cheers and Happy Learning!

Sandip

To view or add a comment, sign in

More articles by Sandip Bhattacharya

Insights from the community

Others also viewed

Explore topics