zero-initialization tag

1 questions


1 answers
97 views
0
How do I initialize all C++ structure member variables to zero?

Is there an easier way to initialize all object member variables to zero?Now struct Snapshot{ double x; int y ;};int main(){ struct Snapshot mystruct; mystruct.x = 0; mystruct.y = 0;}They're resettin...


© 2024 OneMinuteCode. All rights reserved.