I have the code and used namespace, but when I run the program it gives me the error. Any help how to fix it.
help with namespace
Collapse
X
-
The error is namespace name expected
# include <iostream.h>
# include "ListA.h"
# include <conio.h>
using namespace std;
void main()
{
List lst;
for (int i=0; i<30; i++)
{
int num;
cout << "Enter a number: ";
cin >> num;
lst.add(num);
}
lst.print();
int sum = lst.calculateSu m();
cout << "The sum of the List is: "<< sum << endl;
}
getch();Comment
Comment