Question: What is wrong with the following program? #include int * get _ some _ ints ( ) { std::vector ints = { 1 , 2
What is wrong with the following program?
#include
int getsomeints
std::vector ints ;
return ints.data;
getsomeints
int main
int someints getsomeints;
delete someints;
return ;
main
Group of answer choices
the memory pointed to by someints is freed twice
main leaks the memory pointed to by someints
a function cannot return a pointer
someints is a pointer and not an array, so delete should be used instead of delete
nothing is wrong with this program
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
