Go Down

Topic: Way to wrap long string? (Read 640 times) previous topic - next topic


May 29, 2007, 12:42 pm Last Edit: May 29, 2007, 12:43 pm by paulb Reason: 1
Is there a way to get a long string to wrap in the IDE? Putting in a return seems to
break strings.


The only way I can think to do this in C/C++ is to physically break the strings and use the strcat function to recombine them.

I don't think there is a line continuation syntax within the C language definition that would help.


You can do this...
Code: [Select]
const char longstring[] = "aaa"

but you might make sure to learn about <avr/pgmspace.h> and PROGMEM because otherwise your strings all get copied into SRAM and you don't have much of that.


May 29, 2007, 08:56 pm Last Edit: May 29, 2007, 09:22 pm by paulb Reason: 1
Thanks jims - that was easy. I'll put it in the reference section.


Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131