The ABCs of computing
- A
- ASCII (American Standard Code for Information Interchange) is a fundamental character encoding standard that assigns unique numbers (0-127) to 128 basic characters—including English letters (A-Z, a-z), digits (0-9), punctuation, and control codes—allowing computers and devices to communicate and display text universally, forming the basis for modern encoding like Unicode.
- B
- Bit manipulation is the process of algorithmically changing bits, the smallest units of data in a computer
- C
- The C programming language is a powerful, general-purpose, procedural language developed in the early 1970s by Dennis Ritchie at Bell Labs. It is widely influential and remains one of the most popular programming languages, primarily used for system-level programming where performance and low-level memory access are critical.
- 2.6GHz quad-core Intel Core i7 (Turbo Boost up to 3.6GHz)
- 16GB (two 8GB) of 1600MHz DDR3 memory
- 1TB (5400-rpm) hard drive
- 2TB SSD Crucial
- macOS 10.15 Catalina, from 2019, is the last supported.
- In which month or year Catalina will stop to be supported ?
- time to try installing omarchy on it
- The Omarchy Manual
curl -O https://iso.omarchy.org/omarchy-3.1.7.iso
diskutil list # what disk is usb?
sudo dd if=omarchy-3.1.7.iso of=/dev/usb_disk bs=1M conv=sync
-
intis a data type which stores whole numbersint i
-
charis a byte storing a single ASCII value like '?' or 63char character
-
C does not have a String type to easily create string variables.
- Instead, you must use the char type and create an array of characters.
char characters[]char string[]
-
forloop loops through a block of code a number of times.for(i=0;i<=7;i++)
| format | description |
|---|---|
| %s | The char * argument is expected to be a pointer to an array of character type (pointer to a string). Characters from the array are written up to (but not including) a terminating NUL character; if a precision is specified, no more than the number specified are written. If a precision is given, no null character need be present; if the precision is not specified, or is greater than the size of the array, the array must contain a terminating NUL character. |
| %c | The int argument is converted to an unsigned char, and the resulting character is written. |
| %d, %i | The int argument is converted to signed decimal notation. The precision, if any, gives the minimum number of digits that must appear; if the converted value requires fewer digits, it is padded on the left with zeros. The default precision is 1. When 0 is printed with an explicit precision 0, the output is empty. |
| %p | The void * pointer argument is printed in hexadecimal |
| \n | The ASCII value 10 represents the Line Feed (LF) control character, often shown as \n, used to start a new line in text |
format a table with character %c, decimal %d, and use pointer%p to display memory address
char string[]="String";
| string[] | string[0]=S | string[1]=t | string[2]=r | string[3]=i | string[4]=n | string[5]=g | string[6]=\0 |
|---|---|---|---|---|---|---|---|
| decimal | 83 | 116 | 114 | 105 | 110 | 103 | 0 |
| address | 0x16b0e6f14 | 0x16b0e6f15 | 0x16b0e6f16 | 0x16b0e6f17 | 0x16b0e6f18 | 0x16b0e6f19 | 0x16b0e6f1a |
make
gcc a1.c -o a1
./a1
Hello, is there a s in string[]?
|string[] | string[0]=S | string[1]=t | string[2]=r | string[3]=i | string[4]=n | string[5]=g | string[6]=\0|
|:-----------:|:-----------:|:-----------:|:-----------:|:-----------:|:-----------:|:-----------:|:-----------:|
|decimal | 83 | 116 | 114 | 105 | 110 | 103 | 0 |
|address | 0x16b0e6f14 | 0x16b0e6f15 | 0x16b0e6f16 | 0x16b0e6f17 | 0x16b0e6f18 | 0x16b0e6f19 | 0x16b0e6f1a |
| man | Description |
|---|---|
| man less | less - opposite of more |
| man man | the man utility finds and displays online manual documentation pages |
| man make | to determine automatically which pieces of a large program need to be recompiled |
| man ascii | ascii – octal, hexadecimal and decimal ASCII character sets |
| man printf | printf – formatted output |
| man 3 printf | the printf() family of functions produces output according to a format as described below. |
| man 3 stdio | the standard I/O library provides a simple and efficient buffered stream I/O interface |
