Skip to content

Commit 6d79f7c

Browse files
authored
Merge pull request #3827 from CodeHarborHub/dev-3
solved some bugs
2 parents 20570f2 + 2cbcd01 commit 6d79f7c

File tree

12 files changed

+512
-983
lines changed

12 files changed

+512
-983
lines changed

courses/C/beginner-level/Introduction/intro.md

+4-6
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,18 @@ title: "Introduction to C Programming"
44
sidebar_label: Get Started
55
sidebar_position: 1
66
description: "Introduction to C Programming"
7-
tags: [courses,beginner-level,C,Introduction]
8-
---
7+
tags: [courses, beginner-level, C, Introduction]
8+
---
99

10-
#### History of C
10+
## History of C
1111

1212
C is a general-purpose programming language that was developed in the early 1970s by Dennis Ritchie at Bell Labs. It was created as an evolution of the B programming language and was designed for system programming and developing operating systems. C's development was closely tied to the Unix operating system, with most of Unix's kernel and system utilities written in C. Its powerful features, portability, and performance have made it one of the most widely used and influential programming languages in history.
1313

14-
:::note
15-
#### Features and Benefits of C
14+
## Features and Benefits of C
1615

1716
- **Efficiency and Performance**: C is known for its efficiency and performance, making it suitable for system-level programming and applications that require high-speed execution.
1817
- **Portability**: C programs can be easily ported to different platforms with minimal changes, making it a versatile language for cross-platform development.
1918
- **Low-level Access**: C provides low-level access to memory and hardware, allowing developers to write programs that interact directly with the system hardware.
2019
- **Rich Library**: C has a rich standard library that provides numerous built-in functions for performing common tasks.
2120
- **Modularity**: C supports modular programming, allowing developers to split their code into smaller, manageable functions and modules.
2221
- **Widely Used**: C is widely used in various domains, including system programming, embedded systems, game development, and application development.
23-
:::
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
---
22
id: lesson-2
33
title: "Setting up the Development Environment"
4-
sidebar_label: Setting up
4+
sidebar_label: Setting up
55
sidebar_position: 2
66
description: "Setting up the Development Environment"
7-
tags: [courses,beginner-level,C,Introduction]
8-
---
9-
7+
tags: [courses, beginner-level, C, Introduction]
8+
---
109

1110
To write and compile C programs, you need a C compiler and a text editor or an integrated development environment (IDE). Here’s how you can set up a C development environment:
1211

1312
1. **Install a C Compiler**:
13+
1414
- **Windows**: Install MinGW (Minimalist GNU for Windows) which includes the GCC compiler.
1515
- **Linux**: GCC (GNU Compiler Collection) is typically pre-installed. If not, you can install it using your package manager (e.g., `sudo apt install gcc` on Ubuntu).
1616
- **macOS**: Install Xcode Command Line Tools which include the GCC compiler (`xcode-select --install`).
@@ -22,40 +22,44 @@ To write and compile C programs, you need a C compiler and a text editor or an i
2222
#### Writing and Compiling Your First C Program
2323

2424
1. **Writing Your First C Program**:
25+
2526
- Open your text editor or IDE and write the following C program:
2627

27-
```c
28-
#include <stdio.h>
28+
```c title="hello.c"
29+
#include <stdio.h>
2930

30-
int main() {
31-
printf("Hello, World!\n");
32-
return 0;
33-
}
34-
```
31+
int main() {
32+
printf("Hello, World!\n");
33+
return 0;
34+
}
35+
```
3536

3637
- Save the file with a `.c` extension, for example, `hello.c`.
3738

3839
2. **Compiling Your C Program**:
40+
3941
- Open your terminal or command prompt.
4042
- Navigate to the directory where you saved your `hello.c` file.
4143
- Compile the program using the C compiler. For GCC, you can use the following command:
4244

43-
```sh
44-
gcc hello.c -o hello
45-
```
45+
```sh
46+
gcc hello.c -o hello
47+
```
4648

4749
- This command compiles `hello.c` and creates an executable file named `hello`.
4850

4951
3. **Running Your C Program**:
52+
5053
- After compiling, run the executable file by typing the following command in your terminal or command prompt:
5154

52-
```sh
53-
./hello
54-
```
55+
```sh
56+
./hello
57+
```
5558

5659
4. **Output**:
60+
5761
- You should see the output `Hello, World!` printed on the screen.
5862

59-
```
60-
Hello, World!
61-
```
63+
```
64+
Hello, World!
65+
```

courses/C/beginner-level/Structure-and-unions/Intro.md

+8-11
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,24 @@ title: "Structures and Unions in C"
44
sidebar_label: Structures and Unions
55
sidebar_position: 1
66
description: "Learn Structures and Unions in C"
7-
tags: [courses,beginner-level,C,Structures,Unions,Introduction]
8-
---
9-
7+
tags: [courses, beginner-level, C, Structures, Unions, Introduction]
8+
---
109

1110
Structures and unions are user-defined data types that allow the grouping of variables of different types. They provide a way to model complex data structures in a single unit.
1211

13-
#### Defining and Using Structures
12+
### Defining and Using Structures
1413

1514
A structure is a collection of variables, possibly of different types, grouped together under a single name.
1615

1716
### Flowchart for Using Structures
17+
1818
:::note
19+
1920
1. **Define a structure**: Define the structure with the required members.
2021
2. **Declare structure variables**: Declare variables of the structure type.
2122
3. **Assign values to structure members**: Use the dot operator to assign values.
2223
4. **Access and use structure members**: Access values using the dot operator.
23-
:::
24-
24+
:::
2525

2626
```mermaid
2727
flowchart TD
@@ -30,10 +30,9 @@ flowchart TD
3030
C --> D[Access and use structure members]
3131
```
3232

33-
3433
**Defining a Structure:**
3534

36-
```c
35+
```c title="filename.c"
3736
#include <stdio.h>
3837

3938
// Define a structure
@@ -169,7 +168,6 @@ Birthdate: 15-05-1990
169168
Salary: 55000.50
170169
```
171170

172-
173171
#### Example : Using Structures
174172

175173
```c
@@ -199,12 +197,11 @@ int main() {
199197
return 0;
200198
}
201199
```
202-
203200

204201
**Output:**
205202

206203
```
207204
Name: Alice
208205
Age: 30
209206
Salary: 55000.50
210-
```
207+
```

courses/C/overview.md

+63-46
Original file line numberDiff line numberDiff line change
@@ -2,91 +2,108 @@
22
title: Welcome to Learning Path
33
sidebar_label: Course Outline
44
sidebar_position: 1
5-
description: C Language Course Outline.
6-
tags: [courses,C]
7-
keywoards: [courses,C,Language]
5+
description: C Language Course Outline.
6+
tags: [courses, C]
7+
keywoards: [courses, C, Language]
88
author: [CodeHarborHub, Ajay Dhangar]
99
---
10-
1110

12-
#### Beginner Level
11+
### Beginner Level
1312

1413
**1. Introduction to C Programming**
15-
- History of C
16-
- Setting up the development environment
14+
15+
- History of C
16+
- Setting up the development environment
1717

1818
**2. Basic Syntax and Structure**
19-
- Structure of a C program
20-
- Input and output operations
19+
20+
- Structure of a C program
21+
- Input and output operations
2122

2223
**3. Operators and Expressions**
23-
- operators
24+
25+
- operators
2426

2527
**4. Control Flow**
26-
- Conditional statements (if, if-else, nested if,switch)
27-
- Loops (for, while, do-while)
28+
29+
- Conditional statements (if, if-else, nested if,switch)
30+
- Loops (for, while, do-while)
2831

2932
**5. Functions**
30-
- Defining and declaring functions
31-
- Recursion & Scope and lifetime of variables
33+
34+
- Defining and declaring functions
35+
- Recursion & Scope and lifetime of variables
3236

3337
**6. Arrays and Strings**
34-
- Introduction to arrays
35-
- String handling and manipulation
38+
39+
- Introduction to arrays
40+
- String handling and manipulation
3641

3742
**7. Pointers**
38-
- Introduction to pointers
39-
- Pointer to pointer
43+
44+
- Introduction to pointers
45+
- Pointer to pointer
4046

4147
**8. Structures and Unions**
42-
- Defining and using structures
43-
- Introduction to unions
4448

45-
#### Intermediate Level
49+
- Defining and using structures
50+
- Introduction to unions
51+
52+
### Intermediate Level
4653

4754
**1. Dynamic Memory Allocation**
48-
- Introduction to dynamic memory allocation
49-
- Memory management techniques & Issue
55+
56+
- Introduction to dynamic memory allocation
57+
- Memory management techniques & Issue
5058

5159
**2. File Handling**
52-
- Introduction to file handling
53-
- Working with binary files
60+
61+
- Introduction to file handling
62+
- Working with binary files
5463

5564
**3. Advanced Pointers**
56-
- Function pointers
57-
- Dynamic arrays using pointers
65+
66+
- Function pointers
67+
- Dynamic arrays using pointers
5868

5969
**4. Bitwise Operations**
60-
- Introduction to bitwise operators
61-
- Applications of bitwise operations
70+
71+
- Introduction to bitwise operators
72+
- Applications of bitwise operations
6273

6374
**5. Preprocessor Directives**
64-
- Introduction to the C preprocessor
65-
- File inclusion
75+
76+
- Introduction to the C preprocessor
77+
- File inclusion
6678

6779
**6. Error Handling**
68-
- Types of errors (syntax, runtime, logical)
69-
- Error handling in file operations
7080

71-
#### Advanced Level
81+
- Types of errors (syntax, runtime, logical)
82+
- Error handling in file operations
83+
84+
### Advanced Level
7285

7386
**1. Data Structures**
74-
- Introduction to data structures
75-
- Graphs and graph algorithms
7687

77-
**2. Algorithms**
78-
- Sorting algorithms (bubble sort, quicksort, mergesort)
79-
- Searching algorithms (linear search, binary search)
88+
- Introduction to data structures
89+
- Graphs and graph algorithms
90+
91+
**2. Algorithms**
92+
93+
- Sorting algorithms (bubble sort, quicksort, mergesort)
94+
- Searching algorithms (linear search, binary search)
8095

8196
**3. Advanced File Handling**
82-
- File locking mechanisms
83-
- Working with memory-mapped files
97+
98+
- File locking mechanisms
99+
- Working with memory-mapped files
84100

85101
**4. Network Programming**
86-
- Introduction to network programming
87-
- Basic TCP/IP communication
102+
103+
- Introduction to network programming
104+
- Basic TCP/IP communication
88105

89106
**5. Multithreading and Concurrency**
90-
- Introduction to multithreading
91-
- Deadlocks
92-
107+
108+
- Introduction to multithreading
109+
- Deadlocks

0 commit comments

Comments
 (0)