EmbLogic's Blog

how to copy a string in a array..

if we want to insert the elements of a string into a array like

char a[20]=”hello”;

then it will show a error…

because a (array name) is a constant pointer..whose address can not be changed…

and here we try to assign a new address of ‘h’ to the array name..

so we have to use strcpy(built in func) to insert the elements of string in a array….

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>