⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 template.cpp

📁 vc源代码
💻 CPP
字号:
/*
    template.cpp - A program to test trivial templates.
 */
#include    <stdio.h>

template <class T> T Half (T x);;

int main ()
{
    printf ("Return for int is %f\n", (float) Half (7));
    printf ("Return for long is %f\n", (float) Half (7L));
    printf ("Return for double is %f\n", Half (7.0));
    return (0);
}

template <class T> T Half (T x)
{
    return (x / 2);
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -