why Pointer is always (uint8_t *)?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-09-12 3:45 AM
Posted on September 12, 2015 at 12:45
why Pointer is always (uint8_t *)?
does it mean the pointer will never exceed 255?
This discussion is locked. Please start a new topic to ask your question.
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-09-12 5:34 AM
Posted on September 12, 2015 at 14:34
It's a pointer to 8-bit values, the pointer itself is 32-bit wide and can address 4GB
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Up vote any posts that you find helpful, it shows what's working..
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-09-12 12:15 PM
Posted on September 12, 2015 at 21:15I am using STM32F407When I pass a pointer of a string to a function, should I used ( uint32_t * ) instead of (uint8_t*)?Because all the examples that I see uses (uint8_t*)
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-09-12 4:19 PM
Posted on September 13, 2015 at 01:19
The concept of pointers transcends the use of an STM32, you might want to review the K&R chapter on pointers, or that of your primary text.
It's pointing to a series of bytes/characters, these are 8-bit in size. If you used (uint32_t *) you'd be pointing at 32-bit words. sizeof(uint8_t) = 1 // The thing it's pointing AT sizeof(uint8_t *) = 4 // The pointer to it, an ADDRESS sizeof(uint32_t) = 4 // The thing it's pointing AT sizeof(uint32_t *) = 4 // The pointer to it, an ADDRESS All WHAT examples?
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Up vote any posts that you find helpful, it shows what's working..
