#Using C from C++
I am new to C++, so this may be a dumb questions, but what the heck…
I have some C functions that I have used for eons to handle tasks I need
frequently. I am now getting into my first TCL program, and figured I'd just
bring along my standard "support.c" file.
Everything compiled fine. However, when I placed a call to a function in that
file, my link said that the function was undefined.
I solved the problem simply by changing the name of the file from "support.c"
to "support.cp" and typecasting a few places where C++ says that it can't
implicitely convert from (void *) to (char *).
My questions are:
1) Why does changing the file to *.cp fix the problem? I know that this makes
it use the C++ compiler instead of the C compiler, but why does that make any
difference to the linker here?
2) Why can't C++ convert from (void *) to (char *) without typecasting? I
thought that void matched any type, or is that no longer true in C++? Is there
another way to indicate "a pointer of any type"?
– Burt