Skip to content

Commit 9c11a70

Browse files
committed
Add C language
1 parent bff9dd6 commit 9c11a70

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

public/data/_index.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@
1919
"lang": "CPP",
2020
"icon": "/icons/cpp.svg"
2121
},
22+
{
23+
"lang": "C",
24+
"icon": "/icons/c.svg"
25+
},
2226
{
2327
"lang": "Rust",
2428
"icon": "/icons/rust.svg"

public/data/c.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
[
2+
{
3+
"categoryName": "Basics",
4+
"snippets": [
5+
{
6+
"title": "Hello, World!",
7+
"description": "Prints Hello, World! to the terminal.",
8+
"code": [
9+
"#include <stdio.h> // Includes the input/output library",
10+
"",
11+
"int main() { // Defines the main function",
12+
" printf(\"Hello, World!\\n\") // Outputs Hello, World! and a newline",
13+
"",
14+
" return 0; // indicate the program executed successfully",
15+
"}"
16+
],
17+
"tags": ["c", "printing", "hello-world", "utility"],
18+
"author": "0xHouss"
19+
}
20+
]
21+
}
22+
]

public/icons/c.svg

Lines changed: 15 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)