首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > C++ >

运行结果为什么是101?解决方法

2012-04-13 
运行结果为什么是101?C/C++ code#include cstring#include typeinfo#include iostreamusing namespa

运行结果为什么是101?

C/C++ code
#include <cstring>#include <typeinfo>#include <iostream>using namespace std;template<class T>int compare (T x, T y){}template<>int compare<char*> (char* x, char* y) {    if (strcmp (x, y) < 0)        return -1;    if (strcmp (x, y) > 0)        return 1;    return 0;}int main (){    char sz1[] = "c";    char sz2[] = "e";    cout <<compare("c","e")<< endl;}


[解决办法]
1.抄错程序
2.编译器太out 了,可能是vc 6.0

热点排行