how to copy string in array
Dec 27, 2013 at 2:33pm
how i can copy the string from one array to any other array?
1 2 3 4
|
array[10]={"Some Text"};
//it should be transfer to any other array....
|
Dec 27, 2013 at 2:36pm
http://www.cplusplus.com/reference/cstring/strcpy/?kw=strcpy
Dec 27, 2013 at 2:36pm
hope it will helps u ;)
Dec 27, 2013 at 4:59pm
you can use this
strcpy(copy to,copy from);
or you can use a loop and copy every single char to it
char array[10]={"Some Text"};
char Array[10];
for (int i=0; i<10; i++){
Array[i]=array[i];
}
cout<<Array;
Topic archived. No new replies allowed.