Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
KaziRifatMorshed committed Aug 17, 2024
1 parent d01f022 commit afe3008
Show file tree
Hide file tree
Showing 8 changed files with 440 additions and 21 deletions.
4 changes: 4 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"projectName": "Vitamin-C-Programming-book",
"projectOwner": "KaziRifatMorshed"
}
46 changes: 32 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Vitamin-C-Programming-book

Supplement like C Programming guide book for beginners
Link: [https://kazirifatmorshed.github.io/Vitamin-C-Programming-book/](https://kazirifatmorshed.github.io/Vitamin-C-Programming-book/)
Supplement like C Programming guide book for beginners\
Link: <https://kazirifatmorshed.github.io/Vitamin-C-Programming-book/>

# How to contribute

Expand All @@ -15,13 +15,13 @@ Vitamin-C-Programming-book/
└── SUMMARY.md
```

- The `src` directory is where you write your book in markdown. It contains all
* The `src` directory is where you write your book in markdown. It contains all
the source files, configuration files, etc.

- The `book` directory is where your book (html) is rendered. All the output is ready
* The `book` directory is where your book (html) is rendered. All the output is ready
to be uploaded to a server to be seen by your audience.

- The `SUMMARY.md` is the skeleton of your
* The `SUMMARY.md` is the skeleton of your
book, and is discussed in more detail [in another
chapter](../format/summary.md).

Expand Down Expand Up @@ -55,15 +55,15 @@ is very strict and must follow the structure outlined below to allow for easy pa

### Structure

1. **_Title_** - While optional, it's common practice to begin with a title, generally <code
1. ***Title*** - While optional, it's common practice to begin with a title, generally <code
class="language-markdown"># Summary</code>. This is ignored by the parser however, and
can be omitted.

```markdown
# Summary
```

1. **_Prefix Chapter_** - Before the main numbered chapters, prefix chapters can be added
2. ***Prefix Chapter*** - Before the main numbered chapters, prefix chapters can be added
that will not be numbered. This is useful for forewords,
introductions, etc. There are, however, some constraints. Prefix chapters cannot be
nested; they should all be on the root level. And you cannot add
Expand All @@ -75,7 +75,7 @@ is very strict and must follow the structure outlined below to allow for easy pa
- [First Chapter](relative/path/to/markdown2.md)
```

1. **_Part Title_** -
3. ***Part Title*** -
Level 1 headers can be used as a title for the following numbered chapters.
This can be used to logically separate different sections of the book.
The title is rendered as unclickable text.
Expand All @@ -88,7 +88,7 @@ is very strict and must follow the structure outlined below to allow for easy pa
- [First Chapter](relative/path/to/markdown.md)
```

1. **_Numbered Chapter_** - Numbered chapters outline the main content of the book
4. ***Numbered Chapter*** - Numbered chapters outline the main content of the book
and can be nested, resulting in a nice hierarchy
(chapters, sub-chapters, etc.).

Expand All @@ -106,7 +106,7 @@ is very strict and must follow the structure outlined below to allow for easy pa

Numbered chapters can be denoted with either `-` or `*` (do not mix delimiters).

1. **_Suffix Chapter_** - Like prefix chapters, suffix chapters are unnumbered, but they come after
5. ***Suffix Chapter*** - Like prefix chapters, suffix chapters are unnumbered, but they come after
numbered chapters.

```markdown
Expand All @@ -115,7 +115,7 @@ is very strict and must follow the structure outlined below to allow for easy pa
[Title of Suffix Chapter](relative/path/to/markdown2.md)
```

1. **_Draft chapters_** - Draft chapters are chapters without a file and thus content.
6. ***Draft chapters*** - Draft chapters are chapters without a file and thus content.
The purpose of a draft chapter is to signal future chapters still to be written.
Or when still laying out the structure of the book to avoid creating the files
while you are still changing the structure of the book a lot.
Expand All @@ -127,7 +127,7 @@ is very strict and must follow the structure outlined below to allow for easy pa
- [Draft Chapter]()
```

1. **_Separators_** - Separators can be added before, in between, and after any other element. They result
7. ***Separators*** - Separators can be added before, in between, and after any other element. They result
in an HTML rendered line in the built table of contents. A separator is
a line containing exclusively dashes and at least three of them: `---`.

Expand All @@ -141,7 +141,25 @@ is very strict and must follow the structure outlined below to allow for easy pa
- [First Chapter](relative/path/to/markdown2.md)
```

---
***

[Kazi Rifat Morshed](https://kazirifatmorshed.github.io)
## Contributors

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->

<!-- prettier-ignore-start -->

<!-- markdownlint-disable -->

<!-- markdownlint-restore -->

<!-- prettier-ignore-end -->

<!-- ALL-CONTRIBUTORS-LIST:END -->

[![All Contributors](https://img.shields.io/github/all-contributors/KaziRifatMorshed/Vitamin-C-Programming-book?color=ee8449\&style=flat-square)](#contributors)

***

[Kazi Rifat Morshed](https://kazirifatmorshed.github.io)\
KU CSE 230220
28 changes: 28 additions & 0 deletions src/FileOperations/FileOperations.md
Original file line number Diff line number Diff line change
@@ -1 +1,29 @@
# File Operations

# Notes on File Operation with C

| Function |Description |
|-|-|
| `fopen()` |opens new or existing file |
| `fprintf()`| write data into the file \["ফাইল" স্ট্রিম, কি স্ট্রিং ফরম্যাটে সেইভ করব, স্ট্রিম সোর্স] |
| `fscanf()`| reads data from the file ` while(fscanf(fp,"%d",&temp_num)!=EOF){` |
| `fputc()` |writes a character into the file |
| `fgetc()` |reads a character (in loop, character by character) from file `while ((c = fgetc(fp)) != EOF) {printf("%c", c);` |
| `fputs()` |put(WRITE) a whole string to the file |
| `fgets()` |using while(fgets!=NULL), reads "line by line" from file with whitespace and sets to buffer string ` while (fgets(str, 300, f) != NULL) {printf("%s", str);`; `while (fgets(line, sizeof(str_line), f)) {` |
| `fclose()`| closes the file |
| `fseek()` |sets the file pointer to given position |
| `fputw()` |writes an integer to file |
| `fgetw()` |reads an integer from file |
| `ftell()` |returns current position |
| `rewind()`| sets the file pointer to the beginning of the file |

## notes and tricks

* `scanf("%[^EOF]",str);` read full file at once
* `freopen("fileout.txt", "w", stdout);` directly save into the file (steam bypass)
* `fprintf()` e W+ dile full file override hoy, r+ thakle shudhu oi position er char gulo
* `fscanf()`: format `%c` ar `%s` er upor depend kore kivabe source theke ek ek kore collect korbe. jodi `%s` use kori then: ek ekta word by word catch kore, so, \_buff (steam) e ekta ekta kore word dhukse, without counting whitespace characters, so, while loop er vitore amake `printf()` er vitore ekta space ditei hosse Jemon silo temon paite hole `fscanf` er vitore `C` ar `printf` er vitore `S`.
* `int temp = 0; while (fscanf(f_input, "%d", &temp) != EOF) {`
* `while (fscanf(ptr, "%c", &str[i]) != EOF && i < 199) { i++;}`
* ` while((ptr=strstr(str,word))!=NULL) {memmove(ptr,ptr+len,strlen(ptr+len)+1);}`
Loading

0 comments on commit afe3008

Please sign in to comment.