Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
07/13/08 21:56
Read: times


 
#156671 - String literals in program memory.
Responding to: ???'s previous message
Robert Revens said:
Am I missing something obvious?

Yes, where string literals are stored, I think. Give this a try.

void main()	
{
    char data temp[]  = "Test1";
    char data temp2[] = "Test2";

    P2 = temp[4];
    strcpy(temp, temp2);
    P2 = temp[4];
    while(1);
}


List of 6 messages in thread
TopicAuthorDate
Confused by strcopy - C newb.            01/01/70 00:00      
   ... the disassembly            01/01/70 00:00      
      strcpy to a location in code memory            01/01/70 00:00      
   String literals in program memory.            01/01/70 00:00      
      Thank you both...            01/01/70 00:00      
         'temp' holds an address, not the char array.            01/01/70 00:00      

Back to Subject List