473,386 Members | 1,790 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

error:namespace

11
I have this main.cpp program and when it runs gives th error: namespace name expected. Any help?
The error is namespace name expected



# include <iostream>
# include "ListA.h"
# include <conio>
using namespace std;

int 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.calculateSum();

cout << "The sum of the List is: "<< sum << endl;

getch();
return 0;
}
Oct 9 '06 #1
1 1828
D_C
293 100+
Add
Expand|Select|Wrap|Line Numbers
  1. using namespace name;
If you have some reason to do so, otherwise I'm at a loss for what it might be.

Please don't double post either. Double posted here.
Oct 9 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: learning_C++ | last post by:
Hi, I try to use input = new istrstream(argv,strlen(argv)); in my code, but it always says error: " error: parse error before `(' token" please help me! Thanks, #include <map>
0
by: kan | last post by:
I am sorry,I have poor english.. Two Class file is located below one namespace.. it is no error.. namespace Convert (namespace name) WinForm (first class name) ColumnSorter (second class...
3
by: SC | last post by:
i have 2 separate projects: 1) Project A: Class library, written in VB.NET; It's namespace is explicitly defined in the code like: Namespace MyCompany.Project.ClassesA .... End Namespace ...
0
by: | last post by:
I'm trying to use a namespace i've created but i keep getting a compile error at runtime. Here's the files and problem i'm having. Any ideas? index.aspx // file with html, etc index_CB.cs //...
29
by: Tiraman | last post by:
Hi, I Build my own dll with my own namespace name and i would like to put it in one place but for the project bin folder so all of the projects will be able to use it . i tried to put the dll...
2
by: Jiri Netolicky | last post by:
Hi and happy new year to all. I have a problem with including external entities with namespace. I have this master xml wrapper file: <?xml version="1.0" ?> <!DOCTYPE log4j:eventSet...
0
by: XML newbie: Urgent pls help! | last post by:
I am using VB.Net. My program is to connect to a remote IPAddress. Once, it verifies the login information it should display the SessionID and enable some button . I appreciate your help and thanku...
4
by: XML newbie: Urgent pls help! | last post by:
I am using VB.Net. My program is to connect to a remote IPAddress. Once, it verifies the login information it should display the SessionID and enable some button . I appreciate your help and thanku...
4
by: newbie120 | last post by:
Hi all maybe its just been a long day, but i have a question about call access modifiers in C#. Consider the following code. namespace Application { private class Class1 { int i;
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.