compiler error

N

nimrod

hi
i'm trying to compile old c++ ver 4 program with vc++ ver 6
something like that :

tamplate <class tt> class bb
class bb
{
friend class cc<tt>;
};

class cc
{
}

and i get syntax error :'<'
on the line friend class cc<tt>;

i'm new to c++ ..
can any one help

nimrod
 
J

John Harrison

Well there are many mistakes in the code you have posted. Have can anyone
know which is the real mistake when what you post is full of typing
errors. Post *real* code, don't type in something that is roughly right,
post the *real* code, cut and paste if from your compiler along with the
compiler error message.

FWIW here are some of the mistakes in the code below
hi
i'm trying to compile old c++ ver 4 program with vc++ ver 6
something like that :

tamplate <class tt> class bb

Missing semi colon after bb;

class bb was forward declared as a template, but now you've declared it as
a non-template.
{
friend class cc<tt>;

class cc is unknown at this point.
};

class cc

Again above, class cc seems to be a template, but here its not a template.

Missing semi colon here.
and i get syntax error :'<'
on the line friend class cc<tt>;

i'm new to c++ ..
can any one help

Not unless you post the code you are really trying to compile, is that so
hard?

john
 
H

Howard

John Harrison said:
Well there are many mistakes in the code you have posted. Have can anyone
know which is the real mistake when what you post is full of typing
errors. Post *real* code, don't type in something that is roughly right,
post the *real* code, cut and paste if from your compiler along with the
compiler error message.

FWIW here are some of the mistakes in the code below


Missing semi colon after bb;

Not to mention it's "template", not "tamplate"! (Ooops, I mentioned it!
:))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,172
Messages
2,570,934
Members
47,479
Latest member
JaysonK723

Latest Threads

Top