473,405 Members | 2,171 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,405 software developers and data experts.

class does not name a type error

11
I have two classes declared as below
Expand|Select|Wrap|Line Numbers
  1. #include<iostream>
  2. using namespace std;
  3. Class Node
  4. {
  5.       double data;
  6.       Node* Next;
  7.       };
  8. Class List
  9. {
  10. public:
  11.        bool ISEmpty()
  12.        {
  13.             return head == NULL;  //return function  value ,determine if empty or not
  14.        }
  15.       Node*InsertNode(int index,double x); //procedure: insert a new  Node at a particular position 
  16.       int FindNode(double x);              // procedure:  search for node with a given value
  17.       int deleteNode(double x)             //procedure: delete Node with a given value
  18.       void Display();                      // procedure: printing all nodes in the list  
  19.       List()(head = NULL;}                //constructor
  20.       ~List;                              //destructor
  21.       };

and When I try to compile it it gives the following error:
.class does not name a type' for(Node) and (List)
.expected class-name before ';' token for (~List)
. expected declration before };


. Please help me in this regard.
Apr 6 '15 #1

✓ answered by weaknessforcats

If this is C++ you use lower case c:

Expand|Select|Wrap|Line Numbers
  1. class Node
  2. {
  3. etc...

4 4154
weaknessforcats
9,208 Expert Mod 8TB
Does your class begin with a capital C as shown in your post?
Apr 7 '15 #2
xtoma
11
yes the classes begin with a capital C
Apr 7 '15 #3
weaknessforcats
9,208 Expert Mod 8TB
If this is C++ you use lower case c:

Expand|Select|Wrap|Line Numbers
  1. class Node
  2. {
  3. etc...
Apr 7 '15 #4
xtoma
11
Got it! Now it is crystal to me
Apr 8 '15 #5

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

Similar topics

4
by: Benji Luong | last post by:
I just installed IIS 5.1 that came with XP Pro. When I want to browse localstart.asp, this page loads up. How do I resolve this? Thanks so much! HTTP 500.100 - Internal Server Error - ASP...
1
by: Karine Pinault | last post by:
I am having trouble trying to compile existing code with the /clr flag. The following error occurs and I can't figure it out how to fix this problem. I have the following declaration:...
3
by: tuanhoanganh | last post by:
My program has class's name same namespace 's name. Ex namespace clsvoucher public class clsvoucher .......... end class end namespace Can I use Dim a as clsvoucher or I must use Dim a as...
669
by: Xah Lee | last post by:
in March, i posted a essay “What is Expressiveness in a Computer Language”, archived at: http://xahlee.org/perl-python/what_is_expresiveness.html I was informed then that there is a academic...
2
by: paul.dunstone | last post by:
HI all I am using msbuild to compile my web application project. After building the solution I get the following error message: Server Error in '/Community' Application....
70
by: garyusenet | last post by:
I'm using an example piece of code: - namespace Wintellect.Interop.Sound{ using System; using System.Runtime.InteropServices; using System.ComponentModel; sealed class Sound{ public static...
1
by: girays | last post by:
I have a template class which name is EntityRepository and when I compile this class I get no error. But when I use this class in a main method I get LNK2019 linking error. std::map object is used...
4
by: =?Utf-8?B?UGl0Rw==?= | last post by:
Here the facts as code sample: Public Class Class1 Sub ABC(ByVal item As IUnit) End Sub End Class Public Interface IUnit ' or any other Interface ReadOnly Property Heureka() As Activator...
2
by: cr55 | last post by:
I was wondering if anyone can help me with this programming code as i keep getting errors and am not sure how to fix them. The error code displayed now is error: C2228: left of '.rent' must have...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.