C Programming Notes
Programming Language (C)
Topics Covered:
- Basics: Functions, Control Statements (if-else, switch, loops)
- Pointers: Basics, Pointer to Pointer, Pointer to Array, Array of Pointers, Pointer to String,
Pointer to Structures, Pointer to Function, Array of Function Pointers
- Other Concepts: Parameter Passing, Storage Classes, Static & Dynamic Scoping, Recursion
Reference Books:
- Dennis Ritchie
- Yashavant Kanetkar
First Program in C
#include <stdio.h>
int main()
{
printf("Welcome:");
printf("ACE Academy");
printf("\n\tProgramming Classes");
return 0;
}
Explanation
#include <stdio.h>: Preprocessor directive to include standard input-output library.
main(): Entry point of every C program.
Variables in C
A variable is a name of a memory location used to store data. Its value can change during
execution.
Syntax
type variable_list;
Examples
int a;
float b, c;
Rules for Variables
- Can contain alphabets, digits, and underscore.
Example Program
#include <stdio.h>
int main(void)
{
int a = 10;
float b2 = 3.5;
char c_1 = 'A';
printf("%d %f %c", a, b2, c_1);
return 0;
}