0

What mean of this function and their use

bzero (buff,Max); n=0; While ((buff[n++]= getchar())!= `\n`);

18th Sep 2019, 3:40 PM
Anwar Abdalla
Anwar Abdalla - avatar
2 ответов
0
Bzero is a function that takes an array of char as first parameter and its length as a second parameter. It sets all the bytes to zero (b-zero) of that given array (used to be sure everything is at 0). Then you assign in your buffer (the array you declared previously) all the characters typed : getchar allows you to catch the input, and keeps going until the while loop breaks, which is when the enter key ('\n' in ascii) is pressed. In the end you have a sentence which has been stored. It is used for example to get a name, age or any information from the user.
19th Sep 2019, 2:52 AM
Azganor
Azganor - avatar
0
Thanks for explaining You do the best..
19th Sep 2019, 5:05 AM
Anwar Abdalla
Anwar Abdalla - avatar