Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Help Please! (10 pts) CS 3843 Computer Organization I - HW #07 Name/abc123: Due Tue. Mon Jul 31st, 2017 1. (10 pts) A strncpy function
Help Please!
(10 pts) CS 3843 Computer Organization I - HW #07 Name/abc123: Due Tue. Mon Jul 31st, 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 length 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 nCount =7, and the source is an array of length 7 (char array [7]; ), then at index % 36, 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
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started