Here is my programCould you tell me if my exception thrown is correct in this case ? if not, how can I fix it ? May I have you fix it for me please ?PHP Code:std::cout<<"Hey, Nina, tell me how many elements you want to use uhmm ?"<<std::endl;
std::cout<<"After you input the number, I will give you a vector "<<std::endl;
std::cin>>numElem;
std::vector<double> vec(numElem);
if(!vec){
throw std::cerr<<"Sorry, I cant do it for you, another try please"<<std::endl;
exit(1);
}
else
std::cout<<"Cool, there you go, my lady"<<std::endl;
Thanks a lot,
Regards,
homestead




Reply With Quote