NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Support Forum » PSTR ?
September 16, 2012 by Noter |
Noticed I don't have to use PSTR now for string constants. And, I can initialize constants where they are declared. Using gcc 4.5.3 These statements work fine -
Any reason to keep coding the old way? |
---|---|
September 16, 2012 by Noter |
I meant initialize variables where they are declared ... |
September 20, 2012 by pcbolt |
Noter - Are you using this string in your makefile...
I think that lets you get away with the array initialization. As for the "printf", I always thought PSTR was used in the "printf_P" family of functions. The only downside of "printf" is the strings get stored in RAM I believe. |
September 20, 2012 by Noter |
Yes, I do have that in my makefile. You are correct, I eventually ran out of ram so even though it works a few kb is not much space. Went back and changed to PSTR's and all is well again. Thanks for your post. |
Please log in to post a reply.
Did you know that you can make a capacitive proximity sensor with some aluminum foil and paperclips? Learn more...
|