Consider ASCII code for the data security functional C progr
Solution
a) : array s contains 64 elements and it is an array of type \'char\'. Bytes taken by each element of array is 1bytes, thus s is 64 bytes long and s is 512 bits long
b) : hex address of ptr1 is 0028FE70. The decimal equivalent should be :
= 0*1 + 7*16 + 14*(16^2) + 15*(16^3) + 8*(16^4) + 2*(16^5)
= 2686576
c) : As data is entered in s, s array pointer remains same. It still points to beginning of the array.
d) : fgets(s,64,stdin) doesn\'t necessarily read 64 characters. If newline or end-of-file is reached, then it stops reading any more characters. Now if input string is \"DFGHJ\" then 5 characters are printed with \"for\" loop
e) : final value of \'i\' variable would be equal to the length of input string. For example if input string is \"DFGHJ\", then final value of \'i\' variable is 5
![Consider ASCII code for the data security functional C program. All variables and headers are property declared. Char s[64]; unsigned *ptr1 = s; size_t i, j, k Consider ASCII code for the data security functional C program. All variables and headers are property declared. Char s[64]; unsigned *ptr1 = s; size_t i, j, k](/WebImages/15/consider-ascii-code-for-the-data-security-functional-c-progr-1023980-1761529931-0.webp)