Using string type in C with STM32F4
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-10-28 7:54 AM
Posted on October 28, 2013 at 15:54
Hi everyone,
I have to handle strings in my code and I don't know how to use this type of data. I assume that it comes with the compiler I'm using (gcc arm-none-eabi). I found and declared 'string.h' at the begining of my code like this : &sharpinclude <string.h> but it seems like it contains only functions to manipulate strings, and not the type itself. I'm stuck because for now, all I can do is declare strings by initializing a char tab. Thanks for any help. #type #char #string
This discussion is locked. Please start a new topic to ask your question.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-10-28 8:15 AM
Posted on October 28, 2013 at 16:15
I'm stuck because for now, all I can do is declare strings by initializing a char tab.
Strings in C are NUL terminated arrays of characters. C++ might provide a type, C does not. You have to manage strings with in C, handling the space allocated for them, and how they might expand, etc. They are not abstracted like they are with many other languages. A quick shot-gun search with Google turned up these, plenty of others too
http://www.cs.swarthmore.edu/~newhall/unixhelp/C_strings.html
http://www.eskimo.com/~scs/cclass/notes/sx8.html
http://www.tutorialspoint.com/cprogramming/c_strings.htm
http://computer.howstuffworks.com/c35.htm
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
‎2013-10-28 8:52 AM
Posted on October 28, 2013 at 16:52
Thanks Clive, saved me once again.
