c++ code ending up in form.h file

P

Peted

Hi

i am relatively new to the c++ visual studio.net 2003/2005 evniroment.

I am wondering why all the c++ code for winforms apps are being placed
in a .h file. Isnt this against c++ coding convention ?

I understanding it makes no functional difference to the end result,
but arent .h files for funtion headers/definitions etc and CPP files
for actuall code.

Can the default be changed to something i think is more inline with
what i learnt ?

Maybe im behind the times i note c++ convention now also does not
allow for explicit file suffix designation for include ??

EG include <windows.h> is now inlcude<windows>
 
C

Carl Daniel [VC++ MVP]

Peted said:
Hi

i am relatively new to the c++ visual studio.net 2003/2005 evniroment.

I am wondering why all the c++ code for winforms apps are being placed
in a .h file.

Because that's the way the designer works.
Isnt this against c++ coding convention ?

It's diffiert from many C++ coding conventions, yes.
I understanding it makes no functional difference to the end result,
but arent .h files for funtion headers/definitions etc and CPP files
for actuall code.

Can the default be changed to something i think is more inline with
what i learnt ?

No, there isn't anything you can do about it.
Maybe im behind the times i note c++ convention now also does not
allow for explicit file suffix designation for include ??

EG include <windows.h> is now inlcude<windows>

No, it's not. <windows.h> is still <windows.h>. Howver, the C++ standard
header files are as you say:

it's <iostream>, not <iostream.h>, <vector>, not <vector.h>, etc. Windows
API and C header files have the same names they've always had. There's no
change to #include at work here either - the C++ header files are simply
named with no extension.

-cd
 

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