C++运算符重载范例

#include<iostream>
using namespace std;

int add(int a, int b)
{
    return a+b;
}

int main()
{
    string s1 ="abc";
    string s2 ="def";
    string s3 = s1 + s2;

    cout<<s3<<endl;
    cout<<add(10,9)<<endl;
    cout<<10+9<<endl;
    return 0;
}
posted @ 2016-03-30 13:36  夜色下的港湾  Views(123)  Comments(0Edit  收藏  举报