Apr 10 In-Class#
Note
There are no wrong answers. This is for participation credit, and is intended to let me know how well we understand the material at this point.
Access the form: https://forms.gle/8zfGbH52q3EBKvZF7
Consider the following:
double x{10.0}; double *p = &x;
How do we see the value in the memory location that
pis pointing to?Consider the following—what do you think the output printed to the screen is?
#include <vector> #include <algorithm> #include <iostream> bool is_even(int e) { return e % 2 == 0; } int main() { std::vector<int> vec{1, 2, 3, 4, 5, 6, 7, 8}; auto val = std::ranges::count_if(vec, is_even); std::cout << val << std::endl; }