Beginning to program with C++. A few questions

08 Oct 2011

Can someone tell me the difference between a .h file and a .cpp file. I'd like to write my own library for an SPI device and I suppose the library should be quite mainstream. I have a lot of experience with VBA and have taken courses in Java, Fortran and C and OOP so I can hack this and that. What other file types might I find in the mbed compiler ? The library I want to write will be for a DS1307 real time clock and I dont really know how to structure it all. A pointer (no pun intended) to an online resource would be appreciated.

08 Oct 2011

Basically; .c / .cpp are the code, Where >90% of your program is. And the .h files are information, to the compiler ....

For example, my sums.c will have a link to

Multiply.c Divide.c

This link is the .h file.

Hope this helps.

Have a look in cookbook.com a resource for STUDENTS

I am sure there is a few C / C++ books there.

Hope this helps ceri.