strcpy_P -- If you do this:

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
   strcpy_P(msg, "Nuts to you")

Your program will likely blow up because, of course, you string is not in program memory like you're expecting.

You probably meant to put:

   strcpy_P(msg, PSTR("Nuts to you")) ;

Which will do what you expect

If you don't know my whole story, keep your mouth shut.

If you know my whole story, you're an accomplice. Keep your mouth shut. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

#define strcpy_Q(dst, src) strcpy_P((dst), PSTR(src))

Iluvatar is the better part of Valar.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This might be the first time a freak has minded his Ps and Qs.

"Experience is what enables you to recognise a mistake the second time you make it."

"Good judgement comes from experience.  Experience comes from bad judgement."

"Wisdom is always wont to arrive late, and to be a little approximate on first possession."

"When you hear hoofbeats, think horses, not unicorns."

"Fast.  Cheap.  Good.  Pick two."

"We see a lot of arses on handlebars around here." - [J Ekdahl]