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, 22.06.2019 21:00
Ulia is planning to attend the same private four-year college her parents attended. she wants to save at least $18,000 in four years to contribute to her college education. which monthly deposit amounts can julia use to achieve her goal? check all that apply.
Answers: 2
question
Computers and Technology, 23.06.2019 07:00
What are three software programs for mobile computing?
Answers: 1
question
Computers and Technology, 23.06.2019 15:30
Brian wants to conduct an online search with a certain phrase. he intends to use the words books that belong to the 1800s in his search. how should he use the word that in his search?
Answers: 1
question
Computers and Technology, 24.06.2019 00:50
Which player type acts on other players? a. killer b. achiever c. explorer d. socializer
Answers: 1
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
Mathematics, 22.06.2019 18:10
question
Mathematics, 22.06.2019 18:10
question
Computers and Technology, 22.06.2019 18:10
question
Mathematics, 22.06.2019 18:10
Questions on the website: 13722367