Vectors

a. Create the vector via an initialization list.
b. Provide the length of the vector using the sizeof() function.
c. Create a function printVector() to visualize the vectors. This function is the same as the one studied in the lectures but it has to be done using POINTERS.
d. Inside your sorting, there is a group of three statements that switches the positions under comparison. They have to be moved to a new function named swap(), done with POINTERS.
e. Each sorting algorithm must be done with a function and they don’t need to be implemented with pointers.
does anybody know how this can be created?
Stop posting normal C++ questions in the Lounge. Go to Beginners or General.
Last edited on
i couldnt find the ans to it in the beginner and general that is why i posted this ques
In that case, it would be preferred if you bump the beginner thread you made (perhaps adding more detail), if sufficient time has passed. You're also not asking a question. You're just pasting a HW assignment. If you put in more effort, others will usually respond with more effort.
See http://en.cppreference.com/w/cpp/container/vector/vector example at the bottom for an example of initialization list.
Last edited on
Topic archived. No new replies allowed.