<aside> <img src="/icons/home_green.svg" alt="/icons/home_green.svg" width="40px" />
</aside>
Common Error - scanf()
User Input - scanf()
Display - printf()
https://jennychen9827sbu.github.io/CAD281/basic_C.html
https://jennychen9827sbu.github.io/CAD281/timeSpaceComplexity.html
.c file (e.g., hello.c)#include and copies needed code.o file)📌 Command Example:
gcc hello.c -o hello
| Concept | What It Means | Example |
|---|---|---|
#include |
Adds code from a library before compiling | #include <stdio.h> |
| Library | Collection of useful functions | printf() from stdio.h |
int main() |
Entry point of every C program | int main() { ... } |
printf() |
Outputs text to the screen | printf("Hello\n"); |
| Escape Sequence | Special characters starting with \ |
\n (new line), \t (tab), \\ (backslash) |
| Library | What it does | Example Functions |
|---|---|---|
stdio.h |
Input/Output | printf, scanf |
stdlib.h |
Utility functions | malloc, exit |
string.h |
String handling | strlen, strcpy |
math.h |
Math operations | sqrt, pow |
ctype.h |
Character classification | isalpha, toupper |