码迷,mamicode.com
首页 >  
搜索关键字:assignment operator    ( 4169个结果
WPF引用OCX导致的算术运算符溢出
原文链接http://www.ilisen.net/wpf-references-ocx-causes-an-arithmetic-operator-overflow.html这个问题其实原因在于OCX控件与WPF类型的一些不匹配。之前,我在我的项目里面,通过winform控件承载ocx,然后通过中...
分类:其他好文   时间:2014-05-10 08:15:53    阅读次数:486
ACM算法集锦
kurXX最小生成树#include #include #include using namespace std;#define M 501#define LIM 20000000struct edg{ int u,v; int w;}all_e[M*M/2];bool operator > t; ...
分类:其他好文   时间:2014-05-10 00:29:13    阅读次数:470
boost::function实践——来自《Beyond the C++ Standard Library ( An Introduction to Boost )》
代码段1: 1 #include 2 #include 3 4 5 float mul_ints(int x, int y) { return ((float)x) * y; } 6 struct int_div { 7 float operator()(int x, int y)...
分类:编程语言   时间:2014-05-09 23:38:56    阅读次数:487
??复数类--重载运算符3+
请编写程序,处理一个复数与一个double数相加的运算,结果存放在一个double型的变量d1中,输出d1的值,再以复数形式输出此值。定义Complex(复数)类,在成员函数中包含重载类型转换运算符: operator double() { return real; } Input 一个复数与一个double数 Output d1的值和复数形式的此值 Sam...
分类:其他好文   时间:2014-05-09 22:30:21    阅读次数:398
玩转C++运算符重载
运算符重载语法:返回值类型  operator 运算符(参数列表) {  代码逻辑。。。 } C++中的运算符重载是通过函数来实现的,可以将重载的运算符看作是类成的一个成员函数,向普通函数一样调用。如重载String类的 + 运算符,调用的时候可以这样: class { // ..... String operator+(const String &str) { //......
分类:编程语言   时间:2014-05-09 14:05:40    阅读次数:382
C#关键字explicit、implicit、operator 、unsafe 、fixed
今天遇到一些一般不常用,但说不定什么情况下就能用到的C#关键字。转换关键字explicit定义强制转换// Must be defined inside a class called Fahrenheit:public static explicit operator Celsius(Fahrenh...
分类:其他好文   时间:2014-05-08 12:42:03    阅读次数:330
C++ Primer 学习笔记_62_重载操作符与转换 --调用操作符和函数对象
重载操作符与转换--调用操作符和函数对象引言:    可以为类类型的对象重载函数调用操作符:一般为表示操作的类重载调用操作符!struct absInt { int operator() (int val) { return val > 0 ? val : -val; } }; 通过为类类型的对象提供一个实参表而使用调用操作符,所用的方式看起来系那个一个函数...
分类:编程语言   时间:2014-05-08 08:18:17    阅读次数:503
学习笔记---C++伪函数(函数对象)
C++里面的伪函数(函数对象)其实就是一个类重载了()运算符,这样类的对象在使用()操作符时,看起来就像一个函数调用一样,这就叫做伪函数。class Hello{ public: void operator()() //第一个()表示操作符,第二个表示函数参数列表 ...
分类:编程语言   时间:2014-05-08 06:35:33    阅读次数:280
c/c++中#和##链接符号的用法
#include #include /* 英语原文: In function-like macros, a # operator before an identifier in the replacement-list runs the identifier through parameter replacement and encloses the r...
分类:编程语言   时间:2014-05-06 22:01:02    阅读次数:378
为什么operator>>(istream&, string&)能够安全地读入长度未知的字符串?
本文首先试验并分析了scanf("%s", buf);的安全性,然后对operator>>(istream&, string&)的实现细节进行分析,最后仿照operator>>用C语言实现了读入长度未知的字符串(字符行)...
分类:其他好文   时间:2014-05-06 21:17:37    阅读次数:596
4169条   上一页 1 ... 413 414 415 416 417 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!