Task: Pointers
You will solve this exercise starting from the pointers.c
file located in the tasks/pointers/support
directory.
Implement the functions memcpy()
, strcpy()
, and strcmp()
using pointer operations.
To test the implementation, enter the tests/
directory and run:
make check
In case of a correct solution, you will get an output such as:
test_strcmp_equal ........................ passed ... 10
test_strcmp_diff ........................ passed ... 10
test_strcmp_diff2 ........................ passed ... 10
test_memcpy_basic ........................ passed ... 10
test_memcpy_partial ........................ passed ... 10
test_memcpy_struct ........................ passed ... 10
test_memcpy_overlap ........................ passed ... 10
test_strcpy_basic ........................ passed ... 10
test_strcpy_empty ........................ passed ... 10
test_strcpy_long_string ........................ passed ... 10
Total: 100/100
If you’re having difficulties solving this exercise, go through this reading material.