cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
referencing arrays
referencing arrays
Feb 25, 2014 at 10:03am UTC
TheBeardedQuack
(863)
Just a quick question because i wasn't sure how 32b or higher OSs define pointers.
My question is does a pointer refer to a 4byte memory block, or 1 specific byte.
1
2
3
//What would this return
char
ar[8] = {33}; (&ar[0] == &ar[1])
Last edited on
Feb 28, 2014 at 11:37pm UTC
Feb 25, 2014 at 10:44am UTC
kbw
(9488)
My question is does a pointer refer to a 4byte memory block, or 1 specific byte.
It depends on the pointer's type.
A char is one byte. A pointer to a char points to 1 byte.
An int16_t is two bytes. A pointer to an int16_t points to two bytes.
Topic archived. No new replies allowed.