c++实例研究

从0开始

  C++博客 :: 首页 :: 新随笔 :: 联系 :: 聚合  :: 管理 ::
  104 随笔 :: 0 文章 :: 20 评论 :: 0 Trackbacks
/*
  Name: Why C++ ?(basic funtion)
  Copyright: 
  Author: elprup
  Date: 08/10/10 09:18
  Description: 
*/
#include 
<cstdio>
#include 
<cstdlib>

#include 
<iostream>
using namespace std;

int print(const char* s)
{
    printf(
"%s\n", s);
    
return 0;    
}

class trace_cpp
{
public:
    
int print(const char*s){printf("%s\n", s); return 0;}
};

int main()
{
    
//c style trace
    print("Hello from c.");
    
    
//cpp style trace;
    trace_cpp tc;
    tc.print(
"Hello from c++");
    
    system(
"PAUSE");
    
return 0;
}
posted on 2010-10-08 09:44 elprup 阅读(469) 评论(0)  编辑 收藏 引用 所属分类: c++实例

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理