https://github.com/megh2005/cse-1051
For 1st years of HITK
https://github.com/megh2005/cse-1051
c
Last synced: 3 months ago
JSON representation
For 1st years of HITK
- Host: GitHub
- URL: https://github.com/megh2005/cse-1051
- Owner: Megh2005
- License: mit
- Created: 2024-05-14T03:37:36.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-07-09T20:36:01.000Z (almost 2 years ago)
- Last Synced: 2024-07-10T01:04:29.803Z (almost 2 years ago)
- Topics: c
- Language: C
- Homepage:
- Size: 24.4 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
# Coding In C Using Ubuntu Linux OS
## Configuration
### Linux Configuration
Linux comes with its inbuilt C code compiler named `gcc`
- **Create a directory in [Ubuntu](https://ubuntu.com/download/desktop)**
```sh
mkdir directoryname
```
- **Move to the created directory**
```sh
cd directoryname
```
- **Create a file for C code**
```sh
gedit filename.c
```
- **For compilation of code**
```sh
gcc filename.c -o filename.o
```
- **If `math.h` is used then for compilation of code**
```sh
gcc filename.c -o filename.o -lm
```
- **For running the correctly compiled code**
```sh
./filename.o
```
### Windows Configuration
**Windows never comes with any inbuilt C code compiler**
- **Install an external ide. My suggestion is [Dev Cpp](https://sourceforge.net/projects/dev-cpp/files/Binaries/Dev-C%2B%2B%204.9.9.2/devcpp-4.9.9.2_setup.exe/download).**
- **In external ide you can automatically compile and run your code**
## Technicalities
### Topics you should learn before seeing this codes
- **Data types in C**
- **Basic operations in C**
- **Functions in C**
- **Recursion method**
- **Loops and conditions**
- **Arrays in C**
- **Pointers in C**
- **Strings and structures**
- **Files in C**
- **Other minor topics**
### Size of various data types in C
| Data Type| Indicator| Specifier| Size |
| -------- | -------- | ---------|-------|
| Integer | int | %d | 2 byte|
| Decimal | float | %f | 4 byte|
| Character| char | %c | 1 byte|
### A basic hello world programme in C
```c
#include
int main()
{
printf("Hello World");
return 0;
}
```
### Appendix


