C Programming Tutorial

 

Functions
What is functions? We have meet Main at the beginning of this tutorial. Main can be thought of as the master function. In C programming there is only 1 Main function. Inside Main there can be as many functions as possible to do other processing required by the main function.


For example let say a calculator program:

int Main()
{
1. Function to display character on LCD.
2. Function to read number entered by user.
3. Function to perform addition.
4. Function to perform subtraction.
5. Function to perform multiplication.
6. Function to perform division.
}


In order to create a function, we need to write the function name inside the main program, for example function to display character on the Computer Screen:

int Main()
{
void Display();  // we called function Display
}


Remember that we just need to write the name of the function in the Main program. We can then write the function code outside the Main Program. For example:

int Main()
{
void Display();  // we called function Display
}
void Display()
{    
printf(“Displaying numbers : %d \n", a);
}


when the program run, the Main program will process the display function.

 

Microcontroller

What is a Microcontroller?

Microcontroller Specification

Programming PIC16F877A

Playing with a C Programming and PIC16F877A

Creating a Digital Clock using PIC16F877A, LCD and DS1337 Clock IC from Dallas

How to Load Hex File into PIC16F877A

 

Articles :

Lightning Surge Testing

Bit Error Rate Testing

Insertion Loss Testing

 

Light Emitting Diode

DC Power Jack

Voltage Regulator and Diode

Transistor and Operational Amplifier

Trimmer Pot, Relay and PCB

 

Understanding PIC16F877A

Product Development Using PIC16F877A

More Product Development Using PIC16F877A

PIC16F877A Input Output Overview

Interfacing PIC16F877A With LCD

 

VoIP Basic

VoIP Phone

Using VoIP Through Normal PSTN Telephone

What is Codec?

 

C Programming Tutorial

Introduction

What is C programming language?

The First C Program

The First C Program - Explanation

Variables

Printf

Reading User Values

Scanf

Looping

Using FOR loop

Arrays

More on Arrays

Example Program that use Arrays to Compare 6 PIN number

If, Else If, Else

Functions

Pointers

Summary

 

 

 

 

 

 

 

 

 

 

 

Copyright www.electronics.netmyne.com.