Home > SparkNotes > Computer Science Study Guides > Memory >

sparknotes

Arrays: Memory


Problems and Solutions 1

Problem : What is the difference between the following two chunks of code:


if (arr1 == arr2) {
	process();
}

if (! memcmp(arr1, arr2, n * sizeof(int))) {
	process();
}
Assuming arr1 and arr2 are both integer arrays of length n.


Problem : Write code that will make a copy of int arr[SIZE] and point the array int arr_new[] to it.