C Cheat Sheet: Quick Reference for C17 Types, Pointers & I/O
Having a c cheat sheet on hand while coding helps to speed up the process of checking the syntax for data types, storage classes, pointer syntax, and the syntax for the standard library headers. This cheat sheet for C summarizes width of C17 types, precedence of operators, templates for control flow, dynamic memory lifetime (malloc, calloc, realloc and free), and modes for file I/O streams. If you're interviewing for a systems engineering job or writing firmware, a c cheat sheet helps you avoid obscure pitfalls such as omitting null terminators or using const incorrectly on pointers.
C Cheat Sheet: C17 Syntax, Pointers, Memory & Standard Library Reference — Technical Overview
Having a c cheat sheet on hand while coding helps to speed up the process of checking the syntax for data types, storage classes, pointer syntax, and the syntax for the standard library headers. This cheat sheet for C summarizes width of C17 types, precedence of operators, templates for control flow, dynamic memory lifetime (malloc, calloc, realloc and free), and modes for file I/O streams. If you're interviewing for a systems engineering job or writing firmware, a c cheat sheet helps you avoid obscure pitfalls such as omitting null terminators or using const incorrectly on pointers.
#include <stdio.h>
#include <stdint.h>
int main(void) {
printf("sizeof(int32_t) = %zu, sizeof(int64_t) = %zu, sizeof(void*) = %zu\n",
sizeof(int32_t), sizeof(int64_t), sizeof(void *));
return 0;
}
Runnable C example
#include <stdio.h>
#include <stdint.h>
int main(void) {
printf("sizeof(int32_t) = %zu, sizeof(int64_t) = %zu, sizeof(void*) = %zu\n",
sizeof(int32_t), sizeof(int64_t), sizeof(void *));
return 0;
}Expected Output
sizeof(int32_t) = 4, sizeof(int64_t) = 8, sizeof(void*) = 8