Skip to content

Commit

Permalink
added compilation methods
Browse files Browse the repository at this point in the history
  • Loading branch information
FaizanCod committed Oct 20, 2022
1 parent 3d0f6fd commit 246b716
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions c.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: C Programming language
description: C Programming language cheatsheet contains useful code syntax with examples which is handy while coding.
created: 2020-04-25
updated: 2022-10-19
updated: 2022-10-20
---

## Basics
Expand Down Expand Up @@ -464,4 +464,10 @@ All functions defined under `<math.h>` header file.
All functions defined under `<stdlib.h>` header file. These randomized functions are pseudo-random (time-based random functions).
* `random()` : returns a random long
* `srandom(seed)` : seeds the random generator with a new random seed
* `srandom(seed)` : seeds the random generator with a new random seed
## How To Compile in GCC
* `gcc prog.c` : compiles prog.c into a.out, run result with `./a.out`.
* `gcc -o prog prog.c` : compiles prog.c into prog, run result with `./prog`.
* `gcc -g -o prog prog.c` : as above, but allows for debugging.

0 comments on commit 246b716

Please sign in to comment.