subject

The following program stores 80 bool values into a char arr[10]. Complete setBool and getBool. In both functions, index is the index of the bool values, from 0 to 79. getBool returns 1 if the bool value at index is true otherwise 0. Hint: You will probably need most bitwise operations including shifting.
void setBool(char* arr, int index, int boolValue) {
}
int getBool(char* arr, int index) {
}
int main(void) { char arr [10];
memset(arr, 0, 10);
setBool(arr, 78, 1);
setBool(arr, 40, 0);
int b78 = getBool(arr, 78); //b78 is 1 int b40 = getBool(arr, 40); //b40 is 0 return 0;
}

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 22:00
When determining the classification of data, which one of the following is the most important consideration? a. processing systemb. valuec. storage mediad. accessibility
Answers: 2
question
Computers and Technology, 23.06.2019 20:30
If chris has a car liability insurance, what damage would he be covered for
Answers: 1
question
Computers and Technology, 24.06.2019 03:00
With editing, word automatically displays a paste options button near the pasted or moved text. a. cut-and-paste b. drag-and-drop c. inline d. copy-and-carry
Answers: 1
question
Computers and Technology, 24.06.2019 06:30
For which utilities, if any, does the landlord pay?
Answers: 2
You know the right answer?
The following program stores 80 bool values into a char arr[10]. Complete setBool and getBool. In bo...
Questions
question
Social Studies, 15.01.2020 10:31
question
Mathematics, 15.01.2020 10:31
question
Mathematics, 15.01.2020 10:31
question
Mathematics, 15.01.2020 10:31