pointers to objects
Student *b = new Student();
Student *c = new Student();
is this ^ the right way to switch between pointers?
Last edited on
Sure. They're just memory locations = values.
If you don't want to write the code for swapping two things yourself and risking making mistakes you can use std::swap from the <algorithm> header.
Topic archived. No new replies allowed.