C*U
2 楼
这两日在温习86版的红楼,31、32集,感触良多,一言难尽。。。
h*a
3 楼
USA的,很好看.
==以下介绍转载自天涯小筑 转载请注明出处==
USA秋季新剧《不是冤家不聚头》(White Collar)10月23日首播。这是一部相当有意思的剧集(USA最近几部新剧的品质都非常不错)--虽然类型上依然是美国人最喜爱的「罪案调查」,但形式上又有新的「花样」。故事讲述两个男人联手侦破FBI顶级要案,抓获最狡诈的罪犯的故事。这两个人一个是诈骗高手,另一个是专门捉拿诈骗高手的FBI 警探。他们本来没有合作的可能,但事实证明他们合作得很好--除了经常因意见相左而争吵之外。
Neal Caffrey(Matt Bomer扮演,"Chuck","Tru Calling")是一位英俊帅气但是臭名昭著的诈骗犯,最近刚刚从安全等级最高的联邦监狱中成功逃脱。Peter Burke(Tim DeKay扮演,"Tel l Me You Love Me")是一位出色的FBI警探,Neal的死敌。Peter将Neal抓住,然后又故意让他脱逃,自然有他的打算。Elizabeth Burke(Tiffani Thiessen扮演,"What About Brian","Fastlane")是P
==以下介绍转载自天涯小筑 转载请注明出处==
USA秋季新剧《不是冤家不聚头》(White Collar)10月23日首播。这是一部相当有意思的剧集(USA最近几部新剧的品质都非常不错)--虽然类型上依然是美国人最喜爱的「罪案调查」,但形式上又有新的「花样」。故事讲述两个男人联手侦破FBI顶级要案,抓获最狡诈的罪犯的故事。这两个人一个是诈骗高手,另一个是专门捉拿诈骗高手的FBI 警探。他们本来没有合作的可能,但事实证明他们合作得很好--除了经常因意见相左而争吵之外。
Neal Caffrey(Matt Bomer扮演,"Chuck","Tru Calling")是一位英俊帅气但是臭名昭著的诈骗犯,最近刚刚从安全等级最高的联邦监狱中成功逃脱。Peter Burke(Tim DeKay扮演,"Tel l Me You Love Me")是一位出色的FBI警探,Neal的死敌。Peter将Neal抓住,然后又故意让他脱逃,自然有他的打算。Elizabeth Burke(Tiffani Thiessen扮演,"What About Brian","Fastlane")是P
c*9
4 楼
I have a c++ function with this signature void f(char ** input)
char a[10] = "":
strcpy( a, anotherstring.c_str());
f( &a );
The compiler complain about can not convert the type for function f
parameter.
any ideas what is wrong?
thanks,
char a[10] = "":
strcpy( a, anotherstring.c_str());
f( &a );
The compiler complain about can not convert the type for function f
parameter.
any ideas what is wrong?
thanks,
t*g
6 楼
男的太英俊了, 有点太太英俊了, 呵呵, 女生会喜欢看的
X*r
7 楼
'&a' is of type 'char (*)[10]', not of type 'char **'.
【在 c*******9 的大作中提到】
: I have a c++ function with this signature void f(char ** input)
: char a[10] = "":
: strcpy( a, anotherstring.c_str());
: f( &a );
: The compiler complain about can not convert the type for function f
: parameter.
: any ideas what is wrong?
: thanks,
【在 c*******9 的大作中提到】
: I have a c++ function with this signature void f(char ** input)
: char a[10] = "":
: strcpy( a, anotherstring.c_str());
: f( &a );
: The compiler complain about can not convert the type for function f
: parameter.
: any ideas what is wrong?
: thanks,
l*n
9 楼
好看,我一直在追着呢
c*9
10 楼
I think a is name of an array of char, so a is pointer to the a[0], which
should be of type char*, is that correct?
if so &a should be of type char** ?
thanks...
should be of type char*, is that correct?
if so &a should be of type char** ?
thanks...
X*r
12 楼
No, this understanding is wrong.
If you declare 'char a[10];', 'a' has type 'char [10]', and '&a' has
type 'char (*)[10]'.
If you declare 'char *b;', 'b' has type 'char *', and '&b' has type
'char **'.
Type 'char []' can be implicitly converted into type 'char *', so 'a'
can be used in almost everywhere 'char *' is required. However,
'char (*)[]' cannot be converted to 'char **', so your code won't work.
which
【在 c*******9 的大作中提到】
: I think a is name of an array of char, so a is pointer to the a[0], which
: should be of type char*, is that correct?
: if so &a should be of type char** ?
: thanks...
If you declare 'char a[10];', 'a' has type 'char [10]', and '&a' has
type 'char (*)[10]'.
If you declare 'char *b;', 'b' has type 'char *', and '&b' has type
'char **'.
Type 'char []' can be implicitly converted into type 'char *', so 'a'
can be used in almost everywhere 'char *' is required. However,
'char (*)[]' cannot be converted to 'char **', so your code won't work.
which
【在 c*******9 的大作中提到】
: I think a is name of an array of char, so a is pointer to the a[0], which
: should be of type char*, is that correct?
: if so &a should be of type char** ?
: thanks...
X*r
14 楼
What I just said is on the syntactic level.
On the semantic level, a is an array -- it contains all its elements.
It is not the same as a pointer to its first element. The latter is
'&a[0]'. For example, sizeof(a) is 10, which is the length of the array
times size of its individual element; while sizeof(&a[0]) is 4 on
32-bit architecture, which is the size of a 'char *' pointer.
Back to your problem: 'f' requires a 'char ** input'. Now assuming
you could just pass '&a' in. What would happen if f
【在 c*******9 的大作中提到】
: I think a is name of an array of char, so a is pointer to the a[0], which
: should be of type char*, is that correct?
: if so &a should be of type char** ?
: thanks...
On the semantic level, a is an array -- it contains all its elements.
It is not the same as a pointer to its first element. The latter is
'&a[0]'. For example, sizeof(a) is 10, which is the length of the array
times size of its individual element; while sizeof(&a[0]) is 4 on
32-bit architecture, which is the size of a 'char *' pointer.
Back to your problem: 'f' requires a 'char ** input'. Now assuming
you could just pass '&a' in. What would happen if f
【在 c*******9 的大作中提到】
: I think a is name of an array of char, so a is pointer to the a[0], which
: should be of type char*, is that correct?
: if so &a should be of type char** ?
: thanks...
c*9
16 楼
Thank you Xentar...
is the following OK and safe, is strcpy potentially wiping out existing data
(the memory after a)?
char* a:
strcpy( a, anotherstring.c_str());
f( &a );
all I want to do here is to pass a char** that point to a copy of value
anotherstring.c_str()...
what is the best way to do it?
Thanks again.
is the following OK and safe, is strcpy potentially wiping out existing data
(the memory after a)?
char* a:
strcpy( a, anotherstring.c_str());
f( &a );
all I want to do here is to pass a char** that point to a copy of value
anotherstring.c_str()...
what is the best way to do it?
Thanks again.
c*4
17 楼
恩,真得好看。两个男一号都不错,不同的类型。
两人之间那种若有若无的信任让人感觉很窝心。
我这个礼拜疯狂的追着。
是只出到第一季马?
两人之间那种若有若无的信任让人感觉很窝心。
我这个礼拜疯狂的追着。
是只出到第一季马?
X*r
18 楼
No, that's wrong, either, because you didn't allocate memory
for a.
What you want to do could be the following:
char a[10], *b = a;
strcpy(a, anotherstring.c_str());
f(&b);
I didn't reply with the solution immediately because I wanted you
to understand the issue.
Another unrelated reminder is that strcpy is inherently dangerous.
Unless you're 100% sure the length of anotherstring is no greater
than 9, your code is not safe. Use strncpy instead.
existing data
value
【在 c*******9 的大作中提到】
: Thank you Xentar...
: is the following OK and safe, is strcpy potentially wiping out existing data
: (the memory after a)?
: char* a:
: strcpy( a, anotherstring.c_str());
: f( &a );
: all I want to do here is to pass a char** that point to a copy of value
: anotherstring.c_str()...
: what is the best way to do it?
: Thanks again.
for a.
What you want to do could be the following:
char a[10], *b = a;
strcpy(a, anotherstring.c_str());
f(&b);
I didn't reply with the solution immediately because I wanted you
to understand the issue.
Another unrelated reminder is that strcpy is inherently dangerous.
Unless you're 100% sure the length of anotherstring is no greater
than 9, your code is not safe. Use strncpy instead.
existing data
value
【在 c*******9 的大作中提到】
: Thank you Xentar...
: is the following OK and safe, is strcpy potentially wiping out existing data
: (the memory after a)?
: char* a:
: strcpy( a, anotherstring.c_str());
: f( &a );
: all I want to do here is to pass a char** that point to a copy of value
: anotherstring.c_str()...
: what is the best way to do it?
: Thanks again.
d*g
19 楼
看了几集,老觉得年轻男主角装模作样的很假。。。可能不是我的茶
c*9
20 楼
Thanks Xenta...
will the following work also?
char a[10]:
strcpy( a, anotherstring.c_str());
f( &(&a[0]) );
will the following work also?
char a[10]:
strcpy( a, anotherstring.c_str());
f( &(&a[0]) );
p*o
22 楼
Get a C book. You won't learn C from BBS.
BTW, the function f(char **p) looks quite suspicious.
It sounds to me it want to do some tricky things like
freeing *p following by allocating another buffer and
passing it outside, pretty much realloc. It will get
into serious problem if you pass in an array in this
case.
【在 c*******9 的大作中提到】
: Thanks Xenta...
: will the following work also?
: char a[10]:
: strcpy( a, anotherstring.c_str());
: f( &(&a[0]) );
BTW, the function f(char **p) looks quite suspicious.
It sounds to me it want to do some tricky things like
freeing *p following by allocating another buffer and
passing it outside, pretty much realloc. It will get
into serious problem if you pass in an array in this
case.
【在 c*******9 的大作中提到】
: Thanks Xenta...
: will the following work also?
: char a[10]:
: strcpy( a, anotherstring.c_str());
: f( &(&a[0]) );
r*x
23 楼
Did anyone see last night's season finale? It seemed pretty obvious Kate
didn't stay on that plane
didn't stay on that plane
相关阅读
emacs, vim无用论从王垠的代码看似乎其没在正规公司呆过CentOS 7发布了C++/CLI有人用吗?不给果果交保护费的后果求推荐 javascript calculator除了网站和app就没人做其他东西了么请教:移动APP的 服务端开发以前日本PC流行过一个日本自己的OS猛糙快的开发web应用, Node, Rails, Php with framework 你prefer哪个? 那个最好这么多SSL证书,到底有什么区别?三哥的 DESIGN DOCIBM跟苹果联盟:打撒剔牙脸 (转载)什么语言处理xml最方便?给不同客户做小网站,用什么host?请推荐最好的C++/Java/Python开源代码初创小公司给1%的股份,还不如打发叫花子百度牵头“健康云”计划打算装linux搞c++,哪个好 centos? 由本土?哪个大型应用系统用python写的啊?