![]() |
C++ template classes question
:
#include <stdio.h>:
H:\test.cpp:9: error: could not convert template argument `0' to `char*'Using the latest version of Dev-Cpp and whatever Mingw that came with it. My question is...what am I doing wrong here? It compiles perfectly with both VC++ 6 and 2005. |
Replace the stdio with cstdio.
|
umm ok...what was the problem?
|
All the C header files in C++ have a c letter before them.
|
Well my project didn't compile in Dev-Cpp so I extracted that bit. But it sill doesn't compile. How about this?
:
#include <cstdio>Quote:
|
I think pointer template arguments have to have external linkage. Presumably '0' doesn't. You'll have to do some digging.
|
Well, "dlist<int,32,5> motd_lines;" would work just fine. I'm removed the "_DevValue" parameter and it compiled just fine. Thanks everyone.
|
You could try using a cast to _Type around the 0 in the initialiser.
|
Quote:
|
| All times are GMT -5. The time now is 2:35 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC