yangsc51

@dsad
f
re: div阴影[未登录] Yang 2012-09-03 13:36
很棒!
太伟大了!好方法!谢过!
@hadoop中文
哎 都在研究别人的东西
自己没有开发能力吗
一、通过父类型的指针访问子类自己的虚函数

我们知道,子类没有重载父类的虚函数是一件毫无意义的事情。因为多态也是要基于函数重载的。虽然在上面的图中我们可以看到Base1的虚表中有Derive的虚函数,但我们根本不可能使用下面的语句来调用子类的自有虚函数:

Base1 *b1 = new Derive();

b1->f1(); //编译出错

这个我有点问题 不知道我理解对没有
下面是测试代码 我可以运行 我不是找茬
只想学习知识 如果理解错了 能给我讲讲吗
//---------------------------

#include <iostream>
#include <string>

using std::cout;
using std::endl;
using std::string;


class baseC
{
private :

string m_name;

public :

baseC(string name = "Bob"): m_name(name)
{

}

virtual void get()
{
cout << "name = " << m_name << endl;
}

virtual void set(string name)
{
m_name = name;
}

virtual void unable()
{
cout << "This not overWirte" << endl;
}
};

class derivedC : public baseC
{

private :

int m_age;

public :

derivedC(int age = 0):m_age(age)
{

}

void set(int age)
{
m_age = age;
}

void get()
{
cout << "age = " << m_age << endl;
}
};

int main()
{

baseC *c = new derivedC();

c->unable();

return 0;
}
你能把最新的数据格式文档给我发一份吗?尤其是通达信5分钟的,我已破解了通达信的日线数据,希望咱们能多交流!我的联系方式:wo3196@tom.com,wo3196@126.com,QQ:1020903156
你的算法有没有问题我不知道
但是结果很有问题:
1.“Qsort和Merge Sort对于random序列平均差距没那么大”
两者基本都是Θ(n lg n)。
而快排最理想Θ(n lg n),最差情况Θ(n2)。

2.归并排序在各种情况下的时间代价都是Θ(n lg n)。
从你的结果看来,随机和有序竟然差了10倍,显然是有问题的。
有BREWPortingGuideforMSMPlatform这个PDF的可下载链接地址吗?
麻烦您能否给我发一份,上面看不到图。万分谢谢
yangjing_xm@163.com
void print_any(boost::any& a)
{
if (A* pA=boost::any_cast<A>(&a)) //这里有问题!
{
pA->some_function();
}
}
any_case返回的不是指针!
应该是:
try{
A a = boost::any_cast<A>(a);
a.some_function();
}catch(...){}
excellent!
最近可以访问了哈,不知道是不是因为OYH
你好,可以把例子程序给我一份吗?我做个动态链接库,对话框里放GridCtrl显示不出来,谢谢!我邮箱yang97718@yahoo.com.cn