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
相关阅读
狗狗放弃Chrome跟Dart VM整合What is the simple plain text editor in iMAC ?乱弹,二爷的想法J2EE 的面试 越来越变态 (转载)有懂bigtable ,hbase,c*的么?问一个timestamp的问题手机app娱乐可以,干活是不行的。win8.1 Daylight saving 没自动Scala Exercises The easy way to learn Scala.写程序,想算法的时候总是对第一感觉没有信任或者安全感是怎么回事?The 7 Most Data-Rich Companies in the World大家来算算数学吧怎样设计动态显示coltzhao等scala党说说streaming吧clojure这符号花花绿绿的 也是醉了python有什么类似Rstudio或者matlab的IDE吗?app单干没啥前途吧?谁能给我一个TestFlight invitation code ? (转载)关于app创业和webhive一问app的流行只是历史短暂的倒退