Skip to content

Commit

Permalink
fix: typo
Browse files Browse the repository at this point in the history
  • Loading branch information
osmancoskun committed May 20, 2024
1 parent dddaae4 commit 2869f8d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/routes/wiki/development/c/c-101.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,32 +42,29 @@ int main(int argc, char** argv){
return 0;
}
```
### Explaining hello world
```c
#include <stdio.h>
```
* #include <stdio.h>: This line is a preprocessor directive that tells the compiler to include the contents of the stdio.h header file.
* `#include <stdio.h>` This line is a preprocessor directive that tells the compiler to include the contents of the stdio.h header file.
This header file contains declarations for standard input/output functions like printf and scanf, which are used in the program.

```c
int main(int argc, char** argv) {
```
* int main(int argc, char** argv) {: This line defines the main function of the program.
* `int main(int argc, char** argv) {` This line defines the main function of the program.
In C, every program must have a main function, which serves as the entry point of the program. It takes two arguments: argc, an integer representing the number of command-line arguments passed to the program, and argv, an array of strings containing the actual command-line arguments.
```c
printf("Hello World\n");
```

* printf("Hello World\n");: This line uses the printf function to print the string "Hello World" to the standard output (usually the console).
* `printf("Hello World\n");` This line uses the printf function to print the string "Hello World" to the standard output (usually the console).
The \n represents a newline character, which moves the cursor to the next line after printing "Hello World".

```c
}
```
* }: This closing curly brace marks the end of the main function block.
* This closing curly brace marks the end of the main function block.
All the code within the main function is enclosed between { and }.

### Compile code
Expand All @@ -78,4 +75,4 @@ Compile code like this and run:
$ gcc main.c -o main
$ ./main
>>> Hello World
```
```
2 changes: 2 additions & 0 deletions src/routes/wiki/development/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Development Area
### You can find various development documentation here.

0 comments on commit 2869f8d

Please sign in to comment.