basic question to Arrays
I have a basic question to the use of Arrays (I have been searching the net for the answer without success, so now I try here...)
Somewhere in my code I declare two arrays:
Then I want to copy the CONTENT of the 2nd array into the 1st one.
I´m not sure, but I believe that
will just make tempID refer to the same array as TagID,without copying the content.
Is there any predefined method I can use?
Well for strings (char arrays containing a \0 to mark the end of the string), you use the strcpy() call.
For arrays of any other type, use memcpy() or a loop to copy each index yourself
for ( i = 0 ; i < N ; i++ ) b[i] = a[i];