mirror of
https://github.com/Fechin/reference.git
synced 2026-11-21 05:24:10 +03:00
Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
97faacb2ea
2 files changed
+17
-1
No files matched your search
+9
-1
@@ -38,7 +38,7 @@ Run the compiled binary `hello`
|
||||
$ ./hello
|
||||
```
|
||||
|
||||
Output => Hello World
|
||||
Output => Hello World!
|
||||
|
||||
|
||||
|
||||
@@ -185,6 +185,14 @@ printf("%s", greetings);
|
||||
// print "Hell!"
|
||||
```
|
||||
|
||||
Creating String using character pointer (String Literals)
|
||||
```c
|
||||
char *greetings = "Hello";
|
||||
printf("%s", greetings);
|
||||
// print "Hello!"
|
||||
```
|
||||
**NOTE**: String literals might be stored in read-only section of memory. Modifying a string literal invokes undefined behavior. You can't modify it.!
|
||||
|
||||
`C` **does not** have a String type, use `char` type and create an `array` of characters
|
||||
|
||||
|
||||
|
||||
@@ -59,6 +59,14 @@ Commit all your tracked files to versioned history
|
||||
``` shell script
|
||||
$ git commit -am "commit message"
|
||||
```
|
||||
Discard changes in working directory which is not staged
|
||||
``` shell script
|
||||
$ git restore [file]
|
||||
```
|
||||
Unstage a stagged file or file which is staged
|
||||
``` shell script
|
||||
$ git restore --staged [file]
|
||||
```
|
||||
|
||||
Unstages file, keeping the file changes
|
||||
``` shell script
|
||||
|
||||
Reference in new issue
Block a user