Skip to content

Commit 16f8228

Browse files
committed
added cpro 31
1 parent cd62032 commit 16f8228

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

_courses/cl1.101

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
code: cl1.101
3+
name: Introduction to Linguistics - 1
4+
lecturer: Prof Aditi Mukherjee
5+
---
6+
7+
Provides a bird's eye view of the area of linguistics.

_posts/2020-11-24-c-pro-lecture-31.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
title: C Pro Lecture 31
3+
author: Pratyaksh Gautam
4+
code: cs0.101
5+
number: 31
6+
---
7+
8+
### `stdin`, `stdout`, and `stderr`
9+
10+
These are file descriptors, numbered as 0, 1, 2 respectively in linux. What we notmally think of as terminal input and output are `stdin` and `stdout` respectively.
11+
12+
## Files and file pointers
13+
14+
In C, we represent files as pointers to memory, `FILE *`. We have two functions very similar to `printf` and `scanf`, which are `frpintf` and `fscanf` respectively.
15+
16+
This allows us to read names from a file without the need for shell input/output redirection.
17+
```c
18+
char line[100];
19+
FILE* fpointer = fopen("/path/to/input/file", 'r'); /* open the file in read mode */
20+
21+
```
22+
23+
## Commandline arguments

0 commit comments

Comments
 (0)