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 10:00
Which of the following is true of operations within a spreadsheet program’s built-in functions? a. operations within parentheses, then multiplication and division, and then addition and subtraction are computed. b. operations within parentheses, then addition and subtraction, and then multiplication and division are computed. c. multiplication and division, then addition and subtraction, and then operations within parentheses are computed. d. addition and subtraction, then multiplication and division, and then operations within parentheses are computed
Answers: 2
question
Computers and Technology, 22.06.2019 14:30
What percentage of companies is projected to use social media to locate new employees in 2012
Answers: 2
question
Computers and Technology, 22.06.2019 15:00
Atool that matches persoal skills qualities interests and talets to a career is called a
Answers: 1
question
Computers and Technology, 23.06.2019 07:00
To produce a starlight effect in her photograph, lina should choose the filter for her camera.
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, 24.09.2019 16:20
Questions on the website: 13722367