Skip to main content

Section 27.6 Create Digits in Memory

It’s time to create some digits! Remember, each digit can store the actual numerical value to be saved as well as a pointer to the next digit in the number.

Activity 27.3.

Please write the function createDigit() which receives an integer (0-9) as an argument and which creates space in memory for a digit of type digit_t. The function should store the integer passed into it in this newly created digit and then return the address of this digit to the calling function. The function should furthermore initialize the pointer next as the NULL pointer, just to be safe.

admin.....open in new window