0% found this document useful (0 votes)
3 views1 page

C Programming Summary

The document provides an overview of key concepts in C programming, focusing on arrays, pointers, and structures. Arrays are fixed-size collections of elements accessed by index, while pointers store memory addresses and facilitate dynamic memory management. Structures are custom data types that group multiple variables, accessed using the dot operator and can be nested or used in arrays and functions.

Uploaded by

Tatenda Koki
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

C Programming Summary

The document provides an overview of key concepts in C programming, focusing on arrays, pointers, and structures. Arrays are fixed-size collections of elements accessed by index, while pointers store memory addresses and facilitate dynamic memory management. Structures are custom data types that group multiple variables, accessed using the dot operator and can be nested or used in arrays and functions.

Uploaded by

Tatenda Koki
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

C Programming Summary: Arrays, Pointers, and Structures

1. Arrays
- Fixed-size collection of elements of the same type.
- Declared as: int arr[5];
- Initialized as: int arr[3] = {1, 2, 3};
- Accessed by index: arr[0], arr[i]
- Multidimensional: int matrix[2][3];
- Passed to functions as a pointer to the first element.

2. Pointers
- Stores the memory address of another variable.
- Declared as: int *p;
- Assigned using address-of: p = &x;
- Dereferenced with *p to access or modify value.
- Used with arrays, dynamic memory, and function arguments.
- Dynamic memory: malloc, calloc, free.

3. Structures
- Custom user-defined data type grouping multiple variables.
- Declared as:
struct Person {
char name[20];
int age;
};
- Accessed with dot operator: p.age
- Pointer to struct uses -> operator: ptr->age
- Can be nested and used in arrays or functions.

You might also like