Skip to content

Commit 967e279

Browse files
committed
Add VSCode configuration files for C development
- Introduced .vscode/extensions.json to recommend the Clangd extension for improved C code support. - Added .vscode/settings.json to enable format on save and configure Clang format style for consistent code formatting. - Updated comments in bitcount.c for clarity on hexadecimal usage.
1 parent ac2cbfe commit 967e279

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

.vscode/extensions.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["llvm-vs-code-extensions.vscode-clangd"]
3+
}

.vscode/settings.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"editor.formatOnSave": true,
3+
"[c]": {
4+
"editor.formatOnSave": true
5+
},
6+
"C_Cpp.clang_format_style": "file",
7+
"C_Cpp.clang_format_fallbackStyle": "LLVM"
8+
}
9+
10+

chapter_2/exercise_2_09/bitcount.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ void printbits(unsigned int x);
55
int bitcount(unsigned int x);
66

77
int main(void) {
8-
// Using hexadecimal instead of binary literals (0b...) for C89/C99 compatibility
9-
// 0x1A = 0b011010
8+
// Using hexadecimal instead of binary literals (0b...) for C89/C99
9+
// compatibility 0x1A = 0b011010
1010
unsigned int x = 0x1A;
1111

1212
printbits(x);

0 commit comments

Comments
 (0)