strcpy c function not work IOS C custom library for IOS7 -
i using c custom ios library. have upgraded xcode 5.0 developer preview. strcpy not work me crash app @ point. can explain me issue?
update
here code:
char global[] = " "; printf("error opening %s constants input\n", lang); strcpy(global, lang);
in printf
lang working , strcpy not working.
when declare global
as
char global[] = " ";
it enough space two characters. space , string terminator. either set size big enough contain whole string try copy it, or make pointer , allocate dynamically (in case should not forget allocate space string terminator).
Comments
Post a Comment