haas:spring2024:data:week1
Week 1
- Welcome!
- Review, ask questions on C and pointers.
- try writing sample code employing various concepts
- pointers are a fixed size, regardless of data type
- why? MEMORY ADDRESSING
- on lab46 (running on a 64-bit OS/system), memory addresses are 64-bits (64/8 = 8 bytes)
- so all pointers (whether char, int, float, etc.) will be 8 bytes in size on this system.
- on other systems, notably 16-bit and 32-bit systems (especially late-era hardware that might have incorporated tweaks to support more memory than is typically accessible by the default machine word size), memory address sizes can vary.
- takeaway: for code portability, do not assume 8 byte memory addresses. ALWAYS use sizeof() to maximize portability.
haas/spring2024/data/week1.txt · Last modified: 2024/01/27 10:04 by 127.0.0.1