Question regarding partial classes

S

Steve Le Monnier

Partial Classes allow you to split code between two or more physical files,
and during compilation they are re-joined, or so the book says.

If that's the case why is it that I must have namespace using directives in
both classes otherwise I get build errors?

Cheers

Steve Le Monnier
 
A

Andy

I don't think it literally puts the file together into one, it probably
places compiled bits into the obj file and adds more as it goes through
the files.
 
K

Kevin Spencer

The using directive is a device which allows you to leave out the full
namespace when typing in a code file. Since these are code files, they need
the using statements, unless you simply want to type out the full namespace.

--
HTH,

Kevin Spencer
Microsoft MVP
Professional Numbskull

Show me your certification without works,
and I'll show my certification
*by* my works.
 

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

Top