[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: strcpy HELP!!!!



This is your fault.  You need to allocate memory for temp2.

   void main(void)
   {
       char *temp1, *temp2;
       temp1 = malloc (10);
insert `temp2 = malloc (10);' here.
       strcpy (temp1, "high all");
       strcpy (temp2, temp1);
       printf("%s %s", temp1, temp2);
   }


--
To UNSUBSCRIBE, email to debian-user-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


Reply to: