c - Patial copy of string array -


Can I do something to copy string content from one copy to another?

  four ** word = (four **) molk (size of (four *) * line_form); Four ** child terms = (four **) maulok (size (four *) * len1); Int i; (I = startIndex; i & lt; endIndex; i ++) for [hair word [i] = word [i]; }    

Repeat the pointers on the lines of text, so that you You will eventually end up with two arrays, which point to the actual words in real physical memory.

With this problem, if you change the memory through the 'word' then 'hair word' because they will point to the same memory.

The safest way to do this is to get the string length of each 'word' and allocate new memory, copy the string so that 'childWords' points are scattered for different storage.

Comments

Popular posts from this blog

Android - Facebook GraphUser has no email attribute -

Opencart and VQMOD issue: Could not load controller in vq2-system_engine_controller.php -

deployment - How to upload Parent child SSIS package to server -