Re: void* passed as funtion parameters?
"Robby" <Robby@discussions.microsoft.com> wrote in message
news:2A2E2104-4D5B-43F9-A9E3-94EDCDEFDC0A@microsoft.com...
Hello Alex,
template<typename T>
void f1(T* p)
{
p->LK__F1 = 10;
}
wow! that's exactly what I need! But unfortunately PIC MCU'S don't support
C++, they only support assembler or C. Some revolutionary MCU's such as
ARM
which are a little more powerfull are starting to accept C++. But not PICs
... mayby someday they will.
Maybe your C compiler vendor has fed you this line, but C++ support has
nothing to do with the capability of the target processor. It's purely a
compiler feature, both C and C++ compile to machine code just like assembler
does, and if you don't use the expensive C++ features like exceptions, the
C++ code is often even smaller and more efficient than C. And don???t trust
the alternative called "embedded C++". While a subset of C++ that excludes
exceptions makes sense for microcontrollers, the folks behind embedded C++
didn't have a good understanding of runtime cost of various features.
For example, AVR chips are just as simple as PICs but have g++ (a good C++
compiler) capable of producing AVR code.
__________ Information from ESET NOD32 Antivirus, version of virus signature database 4380 (20090829) __________
The message was checked by ESET NOD32 Antivirus.
http://www.eset.com