C Programming Logo MYCPLUS

C Programming Tutorials

C programming is a compelling systems programming language that is a general-purpose and procedure-oriented programming language. It is the most widely used programming language as it sets the fundamental paradigm to develop modern operating systems, compilers, and other systems software. It is an excellent programming language to start learning as a beginner programmer.

A Complete Guide to using Double Pointer in C: Pointer-to-Pointer

A pointer can be declared to point to another pointer which points to a variable. Here, the first pointer contains the address of the second pointer. The second pointer points to an actual memory location where the data is stored, i.e. a variable. That’s the reason why we also call such pointers as double pointers.

Difference between char [] and char * in C?

Generally, the following two statements about char[] and char * in C are considered confusing and understanding the difference between them is important. The first statement puts the literal string “mycplus” in read-only memory and copies the string to newly allocated memory on the stack. The second statement is known as static string allocation and definition.

What are #ifndef and #define Directives

In the C Programming Language, the #ifndef directive checks if the given token has been #defined earlier in the C code. If the token has not been defined earlier then it includes the code between #ifndef and #else. If no #else is present then code between ##ifndef and #endif is included.

Ternary Operator with examples in C

In C Programming, ternary operator allows executing different code depending on the value of a condition. The returned value is the result of the expression when the code is executed. The main advantage of using ternary operator is to reduce the number of lines of code and improve the performance of application. In C, the real utility of ternary operator is that it is an expression instead of a statement i.e. you can have it on the right-hand side (RHS) of a statement. So you can write certain code statements more concisely.

256-Color VGA Programming in C

This tutorial covers many topics in VGA programming in the C programming language. Tutorial assumes that the programmers have a comprehensive understanding of C and should also have a familiarity with DOS and BIOS function calls and interrupts. Knowledge of trigonometry and geometry would also be helpful.

Unions and Structures in C Programming

A union in C programming is a user defined data type which may hold members of different sizes and type. Union uses a single memory location to hold more than one variables. However, only one of its members can be accessed at a time and all other members will contain garbage values. A structure is a convenient tool for handling a group of logically related data items. Structure help to organize complex data is a more meaningful way. It is powerful concept that we may after need to use in our program Design.

Basic Data types and Operators in C

C language provides a standard and minimal set of basic data types. Sometimes these are called primitive data types. More complex data structures can be built up from these basic data types. Data types specify how we enter data into our C programs and what type of data we use for different operations. C has some predefined set of data types to handle various kinds of data that we can use in our program.

Learn File Handling Concepts in C Programming

This article is about file handling using C programming language. File stores information for many purposes and retrieve whenever required by our C programs. A file represents a sequence of bytes on the disk where a group of related data is stored. File is created for permanent storage of data. C programming language can handle files as Stream-oriented data (Text) files and System oriented data (Binary) files.

Graphics in C Language

In a C program, first step is to initialize the graphics drivers on the computer. This is done using the initgraph() method provided in graphics.h  library. In the next few pages we will discuss graphics.h library in more details. Important functions in graphic.h  library will be discussed in details and samples programs will be provided to show the power of C programming language especially for graphic programming developing graphical user interfaces.

Working with Pointers in C

A pointer is a variable that represents the location of a data item, such as a variable or an array element. Pointers are used frequently in C, as they have a number of useful applications. For example, pointers can be used to pass information back and forth between a function and its reference point. Pointers provide a way to return multiple data items from a function via function arguments to
be specified as arguments to a given function.

Arrays in C

In C Programming, an array can be defined as number of memory locations, each of which can store the same data type and which can be referenced through the same variable name. Arrays can be of two types i.e. One Dimensional Array (such as lists) and Multidimensional Arrays (such as tables or matrices).

Functions in C Programming

Function groups a number of program statements into a unit and gives it a name. This unit can be invoked from other parts of a program. A computer program cannot handle all the tasks by it self. Instead its requests other program like entities – called functions in C – to get its tasks done. A function is a self contained, named block of statements that perform a coherent task of same kind. The name of the function is unique in a C Program and is Global. It means that a function can be accessed from any location with in a C Program.

Input and Output in C

The standard way of handling all input and output is done with streams in C programming regardless of where input is coming from or where output is going to. This approach has definite advantages for the programmer. A library package has been evolved which is known as known as the Standard I/O Library which is used in any C program by using stdio.h header. First, however, we need to understand exactly what the terms input and output mean in context of C.

Conditional Statements – if else, for and while loop in C

C programs are executed in a sequence, but we can control the execution of program by using any control mechanism by which we can compare things and come to a decision. This involves using some operations called Relational Operators, conditional statements called if-else and loops. We have fundamental operators to compare two values.

Why Learn C Programming?

C programming language should be the first programming language for students and professionals to become a great Software Engineer, especially when working in Software Engineering Domain. Here I have listed down some of the critical advantages of learning C Language:

  • It helps to understand how a computer works, i.e., how the data is stored and retrieved in the computer system.
  • It provides the foundation for learning other programming languages such as C++, Java, Python, etc.
  • It can handle all the low-level activities and high-level activities in computer systems and compile in almost all of the development platforms.
  • Here are some of the quotes from people who prefers C as first programming language to learn.

Facts about C Language

  • Language of Choice – C language is still the programming language of choice in OS Development, Compilers, and other Systems software development. Here is the paper studying evolution of C.
  • Structured Programming – To solve a problem, C programming language divides the problem into smaller modules called functions or procedures.
  • Execution Speed – C programs run much faster than any other programming language due to less overhead of libraries and support for other facilities such as garbage collection, dynamic typing.
  • Portable Programming Language – Standard C programs are much portable and run without any changes in a wide variety of systems.

First C Program “Hello World”

C is relatively straight forward and simple to use programming language. Here is the most simple program written in the C language. Click on the tutorial links on the left side for detailed information.

#include <stdio.h>
int main()
{
  printf(“Hello World\n”);
  return 0;
}

How to start with C Programming?

Are you confused about starting with C? Here are some of the resources to get you started.

First and foremost, use links on the left to learn about a specific C Topic.

Further, we have picked the ten most trusted C Programming Sources to get you started.

To get you more excited about learning C, we have compiled a list of 10 best applications written in C and C++.

One of the best ways to learn C is writing the code and following the code examples. We have over 100 small C example code to demonstrate different Programming concepts. You can use them in your practice.

Finally, if you are a book enthusiast, then below is the list of ultimate Programming Books for Beginners who want to learn C.

Here's Must-Read List of C programming books for beginners

C Programming Language

C Programming Language, 2nd Edition

With over 600 5-star reviews on Amazon, readers agree that C Programming Language, 2nd Edition by Brian Kernighan and Dennis Ritchie is the best C Programming book for Beginners. The authors present the complete guide to ANSI standard C language programming. Written by the developers of C, this new version helps readers keep up with the finalized ANSI standard for C while showing how to take advantage of C's rich set of operators, economy of expression, improved control flow, and data structures.

21st Century C

21st Century C: C Tips from the New School

Throw out your old ideas about C and get to know a programming language that’s substantially outgrown its origins. With this revised edition of 21st Century C, you’ll discover up-to-date techniques missing from other C tutorials, whether you’re new to the language or just getting reacquainted.

C Programming Absolute Beginner's Guide

C Programming Absolute Beginner's Guide

Greg Perry is the author of over 75 computer books and known for bringing programming topics down to the beginner’s level. His book C Programming Absolute Beginner's Guide, is today’s best beginner’s guide to writing C programs–and to learning skills to use with practically any language. Its simple, practical instructions will help you start creating useful, reliable C code, from games to mobile apps. Plus, it’s fully updated for the new C11 standard and today’s free, open source tools!

C Programming - A Modern Approach

C Programming: A Modern Approach, 2nd Edition

KN King tackles on some C standard library specifics header by header in his C Programming: A Modern Approach book. The second edition maintains all the book's popular features and brings it up to date with coverage of the C99 standard. The new edition also adds a significant number of exercises and longer programming projects, and includes extensive revisions and updates.

C Programming Arduino

Programming Arduino: Getting Started with Sketches

Simon Monk, a Ph.D. in software engineering, writes this great little book for learning to program the arduino using C language. This bestselling guide explains how to write well-crafted sketches using Arduino’s modified C language. You will learn how to configure hardware and software, develop your own sketches, work with built-in and custom Arduino libraries, and explore the Internet of Things—all with no prior programming experience required!