Introduce yourselves!
Icebreaker: Have you tried a VR game? If so, how was it?
Given sender and receiver code fragments below:
// Sender
std::stringstream ss;
char *type = “Hello world”;
.write(type, sizeof(type));
ss/* send to receiver */
// Receiver
std::stringstream ss /* = from sender */;
char *type;
.read(type, sizeof(type)); ss
The above won’t properly transfer the object type string
"Hello world"
from sender to receiver. Briefly explain why
not.
Add code to fix the problem (pseudo-code is fine).
Instead of a char *
, what if type
was a
Vector
with (X,Y) attributes (both of type
float
). Would the original code (e.g.,
ss.write(type, sizeof(type))
work? Briefly explain why the
code might not work as intended.
Write code to fix the (potential) new problem.
What is the “object-oriented” way to address this problem?
Each person in a group should submit their answers:
https://wpi.qualtrics.com/jfe/form/SV_7WGFHFoCYUIhwvI
Make sure to include the names of all group members.
Happy streaming!
– Mark