由买买提看人间百态

topics

全部话题 - 话题: class
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
k***y
发帖数: 104
1
Kudlow: Donald Trump Is the middle-class growth candidate
Larry Kudlow | @Larry_Kudlow
1 Hour Ago
CNBC.com
Did Hillary Clinton actually propose raising middle-income taxes in a recent
speech? The audio suggests she said "we are going to raise taxes on the
middle class," although the prepared remarks indicate she meant "we aren't."
Well, these things happen. But the fact remains that Hillary Clinton's
proposals to raise taxes on the so-called rich, corporations, Wall Street,
investors (making ... 阅读全帖
w*****g
发帖数: 673
2
看得挺震撼的,大城市蓝州的人可能永远也不会接触到这些working class,而川普的
好多发言原来讲的就是他们,他竞选初期去了边境一带,难怪会知道这些working
class 的pain. 如果民主党的候选人们能不要把工作重点放在各种人身攻击,而去听一
下选民的concern, 那可能沉默的大多数就不会对他们那么反感了。
https://www.youtube.com/watch?v=X0sUZxwJHNQ
美国中部的大多数地区非常的萧条贫穷,再中部待过的应该知道,那里的人很想改变现
状啊,川普说的深得他们的心啊,所以都指望川普了.
我在深蓝州,我们州的一部分地区,农民非常辛苦。没挣多少钱,又不愿意去申请福利
,感觉没有尊严,就年复一年地工作着,还要买昂贵的OB医疗。农民的孩子偶尔去了大
城市法学院读书,从来不出去吃快餐以外的餐馆,周围的同学非富即贵。第一次听说美
国有这样贫穷的地方,感到很惊讶。打算去美国穷区旅游。
很多美国人干的体力活养几个孩子,不够条件吃福利,反而非法移民的小孩儿或者小非
法移民享受各种福利,所以上次南加州一个城市人民不让南美洲来的小非法移民入村呢。
身在中... 阅读全帖
a**********2
发帖数: 3726
3
First class, economy class,左臂怎么没有去抗议呢?这不是明目张胆的歧视吗?左
臂是不是要求一律取消economy class,所有人都应该first class; 并且重新命名呢?
t**********3
发帖数: 12623
4
今天包子哥还说开了这些天宝马330才知道奔驰C是多么好。
C真的是该有的都有了,别人没有的它也有。
【 以下文字转载自 Mercedes_Benz_Club 俱乐部 】
发信人: TheIslander2 (Peace de Wars), 信区: Mercedes_Benz_Club
标 题: 奔驰C-Class - 最接近完美的小型sedan
发信站: BBS 未名空间站 (Tue Jun 19 23:01:35 2012, 美东)
先谈谈我上一辆车奔驰C230 Sport,最大的亮点是美学设计,安全性,舒适性,动力和
操控性之间的完美平衡。对比宝马3er,好的地方是更加refined更加well-rounded,不
好的地方是动力不如三系。对比奥迪A4,好的地方是操控更加流畅因为是后驱,不好的
地方是风噪路噪大于A4内饰也不如A4,也许Luxury款会好一些。
纯高速不超过80mph的平均车速可以得到28+mpg,城市里大概20mpg上下。质量很好,非
常DIY-friendly,整车设计简洁但是扎实。之前根本没有期望自己能DIY奔驰,只有试
了才知道奔驰initial desi... 阅读全帖
f******t
发帖数: 7283
5
来自主题: Automobile版 - ML和GL Class在美国生产算是毁掉了
发现很多MB dealer都有这么个现象:展厅里从来不把ML和GL跟别的型号放在一起展示。
这几天看2013款ML,发现美国产的MB质量真是走下坡路了。基本上我在评论MDX那个帖
子里说的MDX的缺点,这段时间产的ML/GL也有同样的问题。考虑ML/GL的人去现场试车
的时候不妨留意一下我说的这些方面。
问题1:德国产MB的车窗周围那一圈镀铬的装饰条,是闪亮的;而ML/GL那个装饰条,质
量差很多,试图想造出闪亮的效果;实际却发暗、发乌,就像被酸雨腐蚀那样。触感的
话德国产的摸上去是金属的感觉,美国产的让人觉得是塑料;怪不得不能放在一起,反
差太明显;
问题2:外壳部件接合基本上没有均匀的。门缝、发动机盖子、车后盖上粗下窄(或者
下粗上窄等等)比比皆是。不需要用尺子量,肉眼就能看出来;对比之下德国产的都没
这方面问题;
问题3:车内饰的软塑料。不是所有的软塑料都是同等的。Focus里面用的是软塑料,劳
斯莱斯里面也有软塑料,两者质量一个天上一个地下。德国产的用的软塑料明显质量很
好,视觉上不过于反光,但也不暗淡,边缘切割锐利,跟其他部件接合细密;ML和GL用
的软塑料却是另外一回事,跟... 阅读全帖
f******t
发帖数: 7283
6
今天偶然比较了一下,发现竟然连Corolla的乘坐空间都要比E class大很多。
E class前座脚部空间只有41.3英寸,但Corolla则有41.7英寸;后座脚部空间E class
只有35.8英寸,但Corolla则有36.3。
比头部空间也是,E class的head room只有37.9英寸,但Corolla则有38.8。
看来E class为了面对首要设计目的——出租车,而强行把后背箱做大,在车体结构上
作出太大的牺牲了。乘客舱被压缩得小到连Corolla都不如,这实在是不厚道。
h**z
发帖数: 9751
7
3个月,奔驰有3万s级订单,疯田有3万烤肉订单,德托跟非礼猫同喜同喜
When Toyota snags 30,000 Corolla orders over a three-month span, it's
entirely possible we're in the midst of a global economic collapse and that
the end is nigh. That's because the scale for Toyota is so very large.
Mercedes-Benz, on the other hand, operates on a much smaller scale,
particularly when we talk about its higher-end models, like the S-Class.
In 2012, Mercedes sold 65,000 of its flagship sedans in Germany and the EU.
That's 178 units per day, for 3... 阅读全帖
j*e
发帖数: 1987
8
昨天去麻省唯一的一家Office Depot准备ship一个first class package,因为之前看
帖子说他们接受first class。结果manager样子的人上来就说只能ship UPS,或USPS
priority mail flat rate.我之前看帖子听说他们有个Rate Sheet,让他把Rate Sheet
拿出来给我看看,我相信那上面肯定有First Class的rate,他开始不肯,说价格都是
根据重量等因素决定的,后来拿出一本USPS的册子上面有详细的rate,但不肯给我看,
只是翻到Priority Mail那一页说就是那个价。我开始还以为这个人对新业务不熟,就
想先在电脑上填了单子,到时候出来option能选First Class就好了。我就要求先自己
在电脑上输入信息,然后按照最便宜的方式寄,他同意了。谁想到,输完后,我是看不
到option的,必须要他输一个密码,然后才能看到。他把电脑转过去,输完密码后,秤
了秤我的包裹,就给我说最便宜的要10块多。靠,怎么可能,我这个包裹才8 OZ。我一
看屏幕他选的是UPS。我说我要用USPS,然后正要拿... 阅读全帖
b***y
发帖数: 554
9
two upgrades available for $120 each. can be used on any UA flights within
North America and the Caribbeans from now until the end of November. Will
upgrade economy to business class on a 3 class configuration (767, 777) or
economy to first class on a 2 class configuration (757, A320/319).
will accpet paypal non credit card or citi transfer.
check out the business class pictures of United airlines 767
http://www.flickr.com/photos/flaneur/3216843044/in/set-72057594051758612/
b***y
发帖数: 554
10
two upgrades available for $90 each. each can upgrade a one way UA flights
within North America and the Caribbeans from now until the end of November.
Will upgrade economy to business class on a 3 class configuration (767, 777)
or economy to first class on a 2 class configuration (757, A320/319).
will accpet paypal non credit card or citi transfer.
check out the business class pictures of United airlines 767
for upgrade terms, visit http://www.united.com/page/article/0,6722,53017,00.html
http://
L*******e
发帖数: 114
11
来自主题: JobHunting版 - C++ protected base class
Here is the code snippet from C++ programing language book. What confused me
is the statement "px = py2", the book says an error "we do not know that
py2 is a Z2 or how Y2::x is used in an non-Z2 object", but g++ did not
complain.
Did I misread something?
class X{
public:
int a;
};
class Y1 : public X {};
class Y2 : protected X {};
class Y3 : private X {};
class Z2 : public Y2 {
void f(Y1* py1, Y2* py2, Y3* py3)
{
X *px = py1; // X is a public base of Y1
py1->a = 7
k***t
发帖数: 276
12
写个Least Recently Used Cache的Class好像是几家公司常见题。
有没有面试可用的精简一些的Sample Code?
或哪个大拿给写一个范本。谢了。
还有,copy-on-write的string class。
我这里贡献一个smart pointer class。Code来自http://www.codeproject.com/KB/cpp/SmartPointers.aspx
class RC
{
private:
int count; // Reference count
public:
void AddRef()
{
// Increment the reference count
count++;
}
int Release()
{
// Decrement the reference count and
// return the reference count.
return --count;
... 阅读全帖
b********n
发帖数: 609
13
按着思路写了一个,是work的。
"
#include
class A {
public:
class Adapter {
public:
Adapter(A& parent)
: ref(parent.a) {
}
private:
friend class B;
int& ref;
};
A() : a(0), i(*this) {
}
Adapter& getAdapter() {
return i;
}
int getNum() const {
return a;
}
private:
int a;
Adapter i;
};
class B {
public:
void changeNum(A& a, int x) {
A::Adapter& i = a.getAdapter();
i.ref = x;
}
};
int main() {
A a;
std::cout << "Original value: " <<... 阅读全帖
h****z
发帖数: 2009
14
来自主题: Parenting版 - suzuki class 还是 private class? (转载)
【 以下文字转载自 ClassicalMusic 讨论区 】
发信人: harryz (Harry), 信区: ClassicalMusic
标 题: suzuki class 还是 private class?
发信站: BBS 未名空间站 (Sun Mar 6 20:42:28 2011, 美东)
女儿今年4岁,在学校group class学了半年小提琴,长进不大。现在想认真学,两个选
择,一个是
suzuki class,现在班里2个6岁的,一个学了2年,1个半年,看了感觉还挺好的。另一
个是大学的老
师,还在本地乐团演奏。请问哪个好点?谢谢。
m*******u
发帖数: 1821
15
4磅以下包裹可以用first class,但是first class不能保价,如果速度正常的话,到
上海10天整。
Priority的话按理是比first class快,一般到大城市是7天,小城市10天,但是奇怪的
是,举例说,反而到上海的包裹比走上海到杭州得反而慢。是因为usps走万国邮联的邮
关,由当地海关清关,上海市区包裹多,所以反而会慢很多。我邮寄去小城市的
priority十天到,邮寄上海的priority通常也要十天甚至2周,还不如first class,这
点有些不解。
最近不要走first class了,十八大召开,所有快递速度慢了很多,往常10天到的包裹
,现在都一个月了还没到,给同学邮寄了奶粉,29号邮寄的现在都没收到。
如果觉得回答的有用,赏个包子吧,穷人最近特别馋包子,呵呵。
m*****m
发帖数: 242
16
这几台都贴出来问问吧
UHD HU6840 Series Smart TV - 55" Class (54.6" Diag.) UN55HU6840FXZA

Be the first to write a review
•UHD 4K TV with UHD Dimming Technology
•Experience Excellent Motion Performance with Clear Motion Rate 240
•Lightning-Fast Quad Core Processor
•Seamlessly Navigate Your Content with the Smart Hub
Suggested Retail:$1,999.99
Your Price:$999.99
You Save: $1,000
ADD TO CART
Price includes $1,000 holiday instant savings - limited time ONLY!!

4K UHD HU... 阅读全帖
a*****2
发帖数: 96
17
TB blood test positive, X-ray negative 这种情况算 class B 还是 no class A or
class B TB?
wh
发帖数: 141625
18
Family Fishing Class
Thursday, May 10, 2012 from 6:00 PM to 8:00 PM (ET)
Fair Haven Branch Library
182 E Grand Ave
New Haven, CT 06513
Learn all you need to know about water, fish, and fishing. This fun two-hour
class, taught by a certified CARE* instructor, will cover where and how to
fish, how to handle fishing gear, what bait to use, how to identify fish and
how to be safe around water. Also, you will learn some of the rules of
fishing in Connecticut waters.
Open to children ages 9-up with an... 阅读全帖
y****t
发帖数: 10233
19
来自主题: SanFrancisco版 - Middle class needs to pay more tax (转载)
【 以下文字转载自 USANews 讨论区 】
发信人: wuwd (woodhead), 信区: USANews
标 题: Middle class needs to pay more tax
发信站: BBS 未名空间站 (Tue Sep 18 12:53:12 2012, 美东)
There have been countless debates regarding who should pay more tax and here
is the simple argument that middle class needs to pay more tax.
The poor does not pay tax so they are out. The rich has always been paying
too much so their tax needs to be cut, the rich also make huge sacrifice to
invest their hard earn money to create jobs that middle class i... 阅读全帖
b*******1
发帖数: 127
20
来自主题: SanFrancisco版 - Fremont: decrease class size and add teachers
From: A
Date: Thu, Mar 14, 2013 at 10:44 AM
Subject: [fremontcouncilpta] Board of Education Approves Lower Class Sizes,
Counselors and Student Support Se
To: f***************[email protected]
 
At the March 13, 2013 meeting, the Board of Education took unanimous action
to add staff and provide support for students, staff, and families for next
school year including:
* The addition of 10 Counselor positions.
* The reduction of kindergarten class size from 30:1 to 28:1 with ... 阅读全帖
x*******8
发帖数: 47
21
Cupertino/Mountain view KungFu Class
现在提供免费试课。
课堂时间

周六 4:00pm-4:50pm
4:55pm-5:45pm
周日 5:00pm-5:50pm
(目前的课是这样的,以后在开新的课会通知大家)
上课地址以及联系方式

微信号 : 459900739

电话号码: 626-320-3505

Email: [email protected]/* */
地址 :213 Moffett Blvd, Mountain View CA

新开课在Cupertino.
时间暂定在周一,周二跟周四的下午6点-7:50pm中间,要看报名的学生的时间再
定。

地址 :10268 Bandley Dr Ste 107 Cupertino, CA 95014
课堂费用
$15 Per class if pay 20 classes
$20 per class if pay 10 cl... 阅读全帖
t********s
发帖数: 35
22
New Tennis Classes will begin this Sunday, at a indoor tennis club in
Charles Town. The tennis classes will be held weekly on Sunday morning.
This week's tennis classes will focus on building fundamentally sound tennis
strokes for each participant.
By the end of the series of classes, players should be able to engage in
basic point, game and match play.
We guarantee you will find our tennis class both lots of fun and highly
productive, and will soon see measurable improvement in your tennis game... 阅读全帖
m*******r
发帖数: 168
23
I had at least two posts about the dance studios in the bay area and the
south bay. Not sure whether or not they were marked by the boardmasters.
Onion and Prada, can you guys please make my previous post available so that
the information can be easily accessed?
Anyway. Here is another attempt.
Starlite (now Cheryle Burk Dance. http://www.cherylburkedance.com/MountainView/index.html) used to be the most popular studio for social dancing in the south bay. Some of the dancesport people in the sout... 阅读全帖
k**L
发帖数: 3630
24
不知道为啥你的邮局会这么说.first class 和prioity对于平常人来说,唯一不同的地
方就是重量,13oz以下就可以用first class. 13oz以上就不能用first class.当然如果
你的物品太大,好像是超过70英寸以上.你也不能用first class.还有一个就是你如果要
寄平邮(贴邮票那种,非包裹),平均厚度必须薄于1/4寸.厚与1/4寸必须寄包裹,而且信封
必须不能是奇形怪状,不能硬邦邦的不能折,有凹凸不平.就是first class,重过13oz必
须prioity 或 parcel select.
z****u
发帖数: 3461
25
萌击链接看图
http://acg.178.com/201211/147297320634.html
11区的确是名副其实的宅国,连来自德国的奔驰名牌也想打入二次元的领域!近日,梅
赛德斯-奔驰新车型A-Class的日本区宣传广告就采用了动画的形式,动画名为「N
EXT A-Class」,由博报堂、葵promotion和Production I.G联合制作!人设是大家熟悉
的EVA漫画作者贞本义行,而音乐更是请来了大神级的井川宪次坐镇,不得不佩服奔驰
的大手笔!(编者按:井川宪次的代表作有「攻壳机动队」、「东之伊甸」等)
而声优方面,虽官网并未公开,不过只用听的大家也能听出女主是由泽城美雪饰演
,另2位男性角色则由铃村健一和津田健次郎献声。官网目前已经推出了「NEXT A-
Class」的公开纪念品套组,其中就包含声优签名板以及女主尼克的手办!当然还有T恤
、iPhone手机壳等。这些都是抽选奖品,运气好才能得到。
【STAFF】
梅赛德斯-奔驰日本NEXT A-Class 制作委员会
制作:博报堂、葵promotion、Production I.G
企画原案监修:佐藤夏生伊藤聪
导演... 阅读全帖
x****y
发帖数: 30
26
来自主题: Java版 - what is $1.class file in Java?
hi,
I have one java application, consisting of two files:
Dots.java and DotsPanel.java.
After I compile them, I got the following four .class file:
Dots.class
DotsPanel.class
DotsPanel$DotsListener.class
DotsPanel$1.class
What are the last two files? what are their usage?
thanks,
c*******n
发帖数: 112
27
Currently, I am working on the memory leak problem of an application.
By using Jprofiler, I found that some classes cannot be released. All these
classes can be traced back to com.altova.xml.Document, which again is
referenced by a sticky class.
Could anyone give me a suggestion how to release the classes that are
referred by the Document class? Thanks a lot.
t*******t
发帖数: 105
28
I just built an example based on the example from Thinking in Java 2nd
The src file is named as MultiClassInOneFile.java
package prac;
class A{} //If i add the modifier public to this class, eclipse
wont com
pile it.
class B{}
public class MultiClassInOneFile{
public static void main(String[] args){
C c = new C();
c.callme();
}
}
class C{
public void callme()
l*******w
发帖数: 61
29
言之有理。多谢了。
看来实在需要的话,只好多加一个attribute....
public class GenericReflection
{
private T object;
private Class objectClass; //cntr passed in
...
}//end class GenericReflection
这样勉强可保证object是null时,也可知其可能的Class。
谢谢
l*******w
发帖数: 61
30
言之有理。多谢了。
看来实在需要的话,只好多加一个attribute....
public class GenericReflection
{
private T object;
private Class objectClass; //cntr passed in
...
}//end class GenericReflection
这样勉强可保证object是null时,也可知其可能的Class。
谢谢
z*******3
发帖数: 13709
31
来自主题: Java版 - 三论abstract class
这个问题是我在实际工作中遇到的
关于singleton pattern
当然也关于abstract class
java1.5之后,singleton有一个非常容易的实现
public enum Singleton{
INSTANCE;
}
这样做有一个限制
如果你对enum了解的话
会发现
enum不支持extends class
但是支持implements interface
所以如果你按照我之前说的,坚决淘汰掉abstract class
只用一层继承,也就是所有的class都implements interface在你的工作中的话
你把以前的singleton class改造成1.5+以上版本的singleton
会非常轻松,而且是完全可行的
但是如果你不这么做的话
那……
写代码是一门艺术,很多人不理解代码的美感
java的美在于它的结构
z*******3
发帖数: 13709
32
来自主题: Java版 - 三论abstract class
真正的结构上的美要从包结构上入手
而不是从类这个层次入手解决
整体结构就应该划分清楚
而不是等到类这个层次再来切割
那就很痛苦了
所以整个软件工程就是从大而小的切割
而不是在最低一层也就是类层面上的切割
通俗点说就是先component diagram
再class diagram,结构应该是先总体后部分
enum是第一个坚决淘汰abstract class机制的api
如果说以前的api是还隐晦地表达对abstract class的不满
比如servlet, struts等使用abstract class的框架逐步被市场所淘汰
或被其它不需要严格继承的框架所替换
使得用户有更大的灵活性
还有很多api可以用abstract class全部具体化,以满足你不愿意继承的需要
的话
那么enum的出现,则是明确地拒绝你使用这种半实现的机制
看api的变迁足够感觉出这个趋势了
你写的那些代码再重要能比enum这个关键字更重要?
哼哼
下班咯,走人
OE
发帖数: 369
33
ldc是这样解释的:
Pushing a String causes a reference to a java.lang.String object to be
constructed and pushed onto the operand stack.
astore是这样解释的:
Pops objectref (a reference to an object or array) off the stack and stores
it in local variable
根据这篇文章http://mindprod.com/jgloss/interned.html#UNDERTHEHOOD
我是这样理解的:
那两个string ref.在ldc时就是相同的。与“Hello!”相对应的string object在class
loading的时候就生成了,而且会有一个weak string ref.(指向这个string object
)被放到一个hashmap里。这个hashmap有时就被称为string pool。当第二个class被
load
,或则说它的runtime c... 阅读全帖
OE
发帖数: 369
34
ldc是这样解释的:
Pushing a String causes a reference to a java.lang.String object to be
constructed and pushed onto the operand stack.
astore是这样解释的:
Pops objectref (a reference to an object or array) off the stack and stores
it in local variable
根据这篇文章http://mindprod.com/jgloss/interned.html#UNDERTHEHOOD
我是这样理解的:
那两个string ref.在ldc时就是相同的。与“Hello!”相对应的string object在class
loading的时候就生成了,而且会有一个weak string ref.(指向这个string object
)被放到一个hashmap里。这个hashmap有时就被称为string pool。当第二个class被
load
,或则说它的runtime c... 阅读全帖
x*****g
发帖数: 764
35
来自主题: Java版 - How to use classes in a jar file?
1 - 我不知道理解你说的没有。在程序B中,在程序A中所有classes还用default
package的时候,没有import任何东西,在程序主体中也可以直接用jar文件中的
classes.但是程序A中所有classes改了package后就不可以了。程序C怎么也不行。
2 - Ctrl+shift+O没反应,但是Ctrl+shift+T能够找到在jar文件中所有的classes. 我
不知道这意味着什么。
3 - 如果要import的话,怎么import?我一直都是加入external jar 文件在路径后就
直接在程序中用jar文件里的classes。Eclipse会提醒我import然后自动import.
请再讲讲。
y****i
发帖数: 156
36
来自主题: Programming版 - C++ class cross reference problem
///
// Change reference to pointer
#include
class index_object_1;
class index_object_2;
class index_object_2_comparator
{
public:
bool operator() (const index_object_2 * lhs, const index_object_2 * rhs)
const
{
return true;
}
};
class index_object_1_comparator {
public:
bool operator() (const index_object_1 * lhs, const index_object_1 * rhs)
const
{
return true;
}
};
class index_object_1 {
private:
double index;
std::set
N***m
发帖数: 4460
37
来自主题: Programming版 - C++ class cross reference problem
I only change test.h to the following. It passed the compilation. But I do
not
know why?
test.h
=============================
#include
class index_object_1_comparator;
class index_object_2_comparator;
class index_object_2;
class index_object_2_comparator {
public:
bool operator() (const index_object_2 & lhs, const index_object_2 & rhs)
const;
};
class index_object_1 {
private:
double index;
std::set::iterator iter;
public:
index_ob
d****p
发帖数: 685
38
来自主题: Programming版 - C++ class cross reference problem
Your code is perfect if you only swap the class declaration/definitons as
below:
index_obj_1 class forward declaration
index_obj_2 class forward declaration
index_obj_1_comparator definition
index_obj_2_comparator definition
index_obj_1 class definition
index_obj_2 class definition
No need to change reference to pointer because in nature they are identical.
c***d
发帖数: 996
39
☆─────────────────────────────────────☆
chamberlain (PKU|PHY01|面朝大海|春暖花开) 于 (Mon Jul 2 18:07:20 2007) 提到:
(c++)为什么不能把这个function的definition放到class里面?
一个很简单的class,如下,编译可以通过
#include
using namespace std;
class Apple{
public:
void print();//declaration
};
void Apple::print() {
cout<<"I am an apple"< }
但是如果把print()的definition部分挪到class里面去,如下,为什么就不行了呢?
#include
using namespace std;
class Apple{
public:
void print();//declaration
m***t
发帖数: 254
40
来自主题: Programming版 - class套class
里面的class ctor initialize外面的class, 这是不是个pattern啊? 这样的话什么时
候可以用里面的那个class来declare啊?
class OutSideClass {
public:
...
private:
struct InSideClass {
InSideClass(OutSideClass *outObj):outSider(outObj){}
OutSideClass *outSider;
}
}
O*****l
发帖数: 13
41
请教这里的C++ guru们,谁能解释一下以下几种C++继承中的基类和继承类在内存中是什
么样的结构:
class A
{
int fieldA;
int func();
}
class B : class A
{
int fieldB;
int func();
}
1. inheritance without virtual functions
[This I know] the memory layout is as simple as: [fieldA fieldB]
2. inheritance with virtual functions
[Not quite clear] looks like in debugger memory [vtprA fieldA fieldB]
should there be a vtable pointer for B?
3. multiple inheritance if there is a class C:A and a class D:B, C
4. multiple inheritance with virtual
b**n
发帖数: 289
42
我有一个GVector 的Class,它有一个copy constructor是用template的。
template
class GVector{
public:
template GVector (const GVector& rhs): length_(rhs.length()
){
ptr_ = new (nothrow) T[length_];
assert(ptr_);
std::copy(&rhs(0), &rhs(0) + length_, ptr_);
}
但我每次在下列情况下(X = T)都会出现运行期的内存错误
GVector v(3);
GVector v2(v);
但如果在X != T时,就没有问题,比如:
GVector v(3);
GVector vi(v);
请问这是怎么回事? 我现在在把我以前写的一些class改成template的,结果问题好多
啊!
谢谢帮忙。
v*****r
发帖数: 2325
43
class base{ base() {}; ~base() {};};
class derived : base { derived() {}; ~derived() {};);
base* ptr = new derived;
explain what will happen
my guess is that:
with out specify virtual function, even through the derived class object is
allocated, but ptr will use base class members… if there is no virtual
function declared in base class.
right?
c**********e
发帖数: 2007
44
来自主题: Programming版 - C++ Q88: nested non-template class (转载)
【 以下文字转载自 JobHunting 讨论区 】
发信人: careerchange (Stupid), 信区: JobHunting
标 题: C++ Q88: nested non-template class
发信站: BBS 未名空间站 (Fri Oct 14 19:41:34 2011, 美东)
Multiple choice: Which of the following statements are true?
A. Non-template classes can be nested.
B. It is possible to nest one class template inside another.
C. Class templates cannot be nested.
D. Class templates can be nested.
c**********e
发帖数: 2007
45
第一个人的回答:
1. Struct has public access by default (class has private access).
2. When you are going to inherit from that class.
第一个人的第一点我明白。但第二点也是谈public/private的问题吗?
第二个人的回答:
Another difference between struct and class can be shown if you try to
declare struct MyClass; or class MyStruct; Both keywords are not
interchangeable in declarations, not just for class/struct definitions.
第二个人的回答是什么意思?
Source:
http://stackoverflow.com/questions/50447/favorite-c-interview-q
z*****n
发帖数: 447
46
比如:
#include
class f{
public:
virtual void p(){printf("father\n");}
};
class c : public f{
public:
void p(){
printf("child\n");
}
};
--------------------------------------
Derived Class 调用Base Class可以这样:
f *a = new c;
a->f::p(); // 这里Print的是"father"
---------------------------------------
如果
f *b = new f;
b怎样才可以调用到 c的method p()
多谢!
z*****n
发帖数: 447
47
比如:
#include
class f{
public:
virtual void p(){printf("father\n");}
};
class c : public f{
public:
void p(){
printf("child\n");
}
};
--------------------------------------
Derived Class 调用Base Class可以这样:
f *a = new c;
a->f::p(); // 这里Print的是"father"
---------------------------------------
如果
f *b = new f;
b怎样才可以调用到 c的method p()
多谢!
g***a
发帖数: 114
48
来自主题: Programming版 - C++class指针转换
thinking in C++ 的一道作业题,关于class的指针转换,想说明C中存在此类"hole",
而C++可以规避。可是自己编程发现程序结果与solution刚好相反,望指点。
原题如下
Create a class called bird that can fly( ) and a class rock that can’t.
Create a rock object, take its address, and assign that to a void*. Now take
the void*, assign it to a bird* (you’ll have to use a cast), and call fly(
) through that pointer. Is it clear why C’s permission to openly assign
via a void* (without a cast) is a “hole” in the language, which couldn’t
be propagated into C++?
solution:... 阅读全帖
首页 上页 1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)