The "Essential" Standard Functions
- Ashok Kumar Kumawat
- Feb 3
- 2 min read
In a professional C or embedded environment, we call these Standard Library Functions. While you won't use printf inside a car's braking system (because there is no screen to print to!), you will use it constantly during testing and debugging on your PC or through a UART console.

Here is the "Essential List" of functions every embedded engineer should know by heart.
1. Input / Output Functions (stdio.h)
printf (Print Formatted)
What it does: Sends a formatted string to the "Standard Output" (usually your console).
Syntax: int printf(const char *format, ...);
Returns: The total number of characters printed. If it fails, it returns a negative number.
scanf (Scan Formatted)
What it does: Reads input from the keyboard/console and stores it in variables.
Syntax: int scanf(const char *format, ...);
Returns: The number of items successfully read and assigned.
Corporate Warning: We rarely use scanf in real products because it is "blocking" (it stops everything until you type) and unsafe if the user types too much data.
2. String Manipulation (string.h)
strlen (String Length)
What it does: Counts how many characters are in a string (not counting the null terminator \0).
Syntax: size_t strlen(const char *str);
Returns: The number of characters (as an unsigned integer).
strcpy (String Copy)
What it does: Copies a "Source" string into a "Destination" buffer.
Syntax: char strcpy(char dest, const char *src);
Returns: A pointer to the destination string.
Safety Tip: In the industry, we prefer strncpy because it lets us set a limit so we don't crash the memory (Buffer Overflow).
strcmp (String Compare)
What it does: Compares two strings alphabetically.
Syntax: int strcmp(const char str1, const char str2);
Returns: * 0 if they are identical.
Positive if str1 is "greater."
Negative if str2 is "greater."
3. Memory Operations (string.h)
Note: These are the "Workhorses" of Embedded C.
memset (Memory Set)
What it does: Fills a block of memory with a specific value.
Example: Clearing a sensor data array to all zeros.
Syntax: void memset(void ptr, int value, size_t num);
Returns: A pointer to the memory area.
memcpy (Memory Copy)
What it does: Copies a block of raw bytes from one place to another.
Example: Moving a packet of SPI data into a processing buffer.
Syntax: void memcpy(void dest, const void *src, size_t num);
Returns: A pointer to the destination.
4. General Utilities (stdlib.h)
abs / labs (Absolute Value)
What it does: Turns a negative number into a positive one. Very useful for sensor error calculations.
Syntax: int abs(int n);
Returns: The positive value of the integer.
atoi (Alpha to Integer)
What it does: Converts a string (like "123") into an actual number (123).
Syntax: int atoi(const char *str);
Returns: The converted integer.
Summary Reference Table
Function | Library | Purpose | Key Return |
printf | stdio.h | Output text | Character count |
strlen | string.h | Get string size | Length |
memset | string.h | Zero-out/Fill memory | Pointer to start |
memcpy | string.h | Copy raw data blocks | Pointer to start |
strcmp | string.h | Check if strings match | 0 if equal |
Professor's Challenge:
In your AUTOSAR/Jacinto testing, you will likely use memcpy to move data from the SPI Internal Buffer to your Test Report buffer.
Comments