Question: Please complete in C. void add_prefix(char* number, char p0, char p1); //Pointer 'number' is pointing a NULL terminated string, which has enough memory to add

Please complete in C.

void add_prefix(char* number, char p0, char p1);

//Pointer 'number' is pointing a NULL terminated string, which has enough memory to add

//two more characters.

//Move all the characters of the string 2 positions right.

//Insert 'p0' at the first index of the string.

//Insert 'p1' at the second index of the string.

char* extend_to_word_size(char* number, int word_size);

//If the length of the 'number' is greater than 'word_size' report error.

//If the length of the 'number' is less than 'word_size' do the followings:

// Allocate enough memory for a new word.

// Fill the most significant extra digits of the word with zeros and copy

// the least significant digits from the number.

// Free the memory from the pointer 'number'.

// Point the new word by the pointer 'number'.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!