Question: HELP!!! (10 pts) CS 3843 Computer Organization I-HW #07 Name/abc123: Due Wed Nov 151h, 2017 1. (10 pts) A strncpy function in C copies the

HELP!!!

HELP!!! (10 pts) CS 3843 Computer Organization I-HW #07 Name/abc123: Due Wed

(10 pts) CS 3843 Computer Organization I-HW #07 Name/abc123: Due Wed Nov 151h, 2017 1. (10 pts) A strncpy function in C copies the source string to the destination and ends when either the number of characters copied equals "nCount" or the source string has a NULL terminator. Write a strncpy function in assembly and prove that is works by executing the program. If the ength of source is less than "nCount" then the remainder is padded with NULL bytes. If the length of source is greater than "nCount", the last character in the destination should be a NULL. So if nCount7, and the source is an array of length 7 (char array[7 then at index #6, the value should be zero. Array [ 6-0; Index #6 IS the 7th character as the first character is index #0. Note: The REAL strncpy can leave the destination NOT NULL-terminated, so your function is a slight deviation from it. Strncpy(char destination, char *source, int nCount)1 Deliverables: Hard copy of the source code and a screenshot of the output of your program running. Make sure to show 3 cases: 1. Length of source length of destination. 2. Length of source > length of destination. 3. Length of source length of destination

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!