Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

关于G++编译器的一点点发现

Posted by blablabla at 2007-01-13 21:49:14 on Problem 2001
显然,如果定义了如下local variable:
string str;
int a = 5;
然后进行赋值 str = a;
编译无法通过:invalid conversion from 'int' to 'const char*'

但是,如果str是某个object的属性,情况就不同了。。。。

比如

class StrWrap
{
   string str;
};

StrWrap wrap;

然后,wrap.str = a;可以编译通过!至少我的g++如此

一个小的笔误耽误我好几个小时。。。。。

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator