1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
// I added indentation here. Indentation is your friend
int main()
{
int productIds[]= {4, 5, 8, 10, 13};
string products[] = { "computer", "flash drive", "mouse", "printer", "camera" };
try
{
getProductID(productIds, products, 5, "mouse");
getProductID(productIds, products, 5, "camera");
getProductID(productIds, products, 5, "laptop");
}
catch(exception& e)
{
cerr << "Exception caught: " << e.what() <<endl;
}
return 0; // you generally want to return 0 from main, as that indicates the program
// ran successfully. Any nonzero value means it did not run correctly/successfully.
}
|