//The code contains 10 distinct syntax errors.
//Rewrite the code, correcting all syntax errors.
int _tmain(int argc, _TCHAR* argv[])
{
int numStamps{4} = {0,0,0,0};
ProcessFileData(numStamps);
DisplayDenominationTable(numStamps);
double totalCost = CalculateCost(numStamps);
cout << "Total cost of stamps is " << totalCost << " euro"<< endline;
return 0;
}
//this is my guess, so far(could not find all 10 errors) please correct me,where i am wrong:
int _tmain(int argc, _TCHAR* argv[])
{
int numStamps;
int numStamps[4] = (0;0;0;0);
ProcessFileData(numStamps);
DisplayDenominationTable(numStamps);
double totalCost = CalculateCost(numStamps);
cout << "Total cost of stamps is " << totalCost << " euro"<< endl;
return 0;
}
PulsarScript
0
Junior Poster
Recommended Answers
Jump to PostAssuming the code is a snippet and not complete, there are only two direct errors (braces instead of brackets on line 6 and
endline
instead ofendl
on line 12).If there are supposed to be 10 errors, you can't make the assumption that headers were included properly, namespace std …
All 3 Replies
deceptikon
1,790
Code Sniper
Team Colleague
Featured Poster
PulsarScript
0
Junior Poster
Suzie999
245
Coding Hobbyist
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.