You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: concepts/basics/about.md
+8-7Lines changed: 8 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
# About
2
2
3
3
C is a statically typed language, which means that everything has a type at compile-time.
4
-
Choosing a name for a [variable][] and setting its type is referred to as declaring a variable.
4
+
Choosing a name for a [variable][variable] and setting its type is referred to as declaring a variable.
5
5
6
6
A variable is declared by explicitly specifying its type.
7
7
A variable name [must follow some rules][name-rules] like starting with either a letter or an underscore.
@@ -28,13 +28,13 @@ foo = 25; // Update to new value
28
28
foo = false; // Compiler error when assigning value of a different type
29
29
```
30
30
31
-
C is an [imperative][][procedural][] language.
32
-
All computation is carried out as part a series of [statements][] that are part of a [function][] or multiple functions.
31
+
C is an [imperative][imperative][procedural][procedural] language.
32
+
All computation is carried out as part a series of [statements][statements] that are part of a [function][function] or multiple functions.
33
33
34
-
Each function can have zero or more [parameters][].
34
+
Each function can have zero or more [parameters][parameters].
35
35
When defining a function all parameters, and the return value must be explicitly typed.
36
36
Values are returned from functions using the [`return` keyword][return-keyword].
37
-
Functions have external [storage class][] by default, meaning that it exists for the lifetime of the program and can be visible externally to the file.
37
+
Functions have external [storage class][storage_class] by default, meaning that it exists for the lifetime of the program and can be visible externally to the file.
38
38
To prevent this the `static` keyword can be added to specify internal visibility.
39
39
40
40
```c
@@ -44,7 +44,7 @@ static int add(int x, int y) {
44
44
```
45
45
46
46
In the above example, the variables `x` and `y` can only be used within the function that is, they have function scope.
47
-
[Scope][] is the idea that the value associated with a name (of a program element) is only accessible within the code "area" where it is defined.
47
+
[Scope][scope] is the idea that the value associated with a name (of a program element) is only accessible within the code "area" where it is defined.
48
48
The principal code areas in C are:
49
49
50
50
- file
@@ -57,7 +57,7 @@ Functions are invoked by specifying the function name and passing arguments for
57
57
int sum = add(1, 2);
58
58
```
59
59
60
-
C supports two types of [comments][].
60
+
C supports two types of [comments][comments].
61
61
Single line comments are preceded by `//` (since C99) and multi-line comments are inserted between `/*` and `*/`.
0 commit comments