我如何获得定义为char buf [] =" abcde&quot ;;的buf地址 [英] how can i get the address of buf which defined as char buf[] = "abcde";

查看:86
本文介绍了我如何获得定义为char buf [] =" abcde&quot ;;的buf地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


i想得到buf的地址,定义为


char buf [] =" abcde" ;


所以可以打电话

strsep(buf的地址,指向令牌的指针);

谢谢


baumann @ pan

hi all,

i want to get the address of buf, which defined as

char buf[] = "abcde";

so can call
strsep(address of buf, pointer to token);
thanks

baumann@pan

推荐答案

ba ********* @ gmail.com 写道:
大家好,

我想得到buf的地址,定义为

char buf [] =" abcde" ;;

所以可以调用
strsep(buf的地址,指向令牌的指针);

谢谢

baumann @ pan
hi all,

i want to get the address of buf, which defined as

char buf[] = "abcde";

so can call
strsep(address of buf, pointer to token);
thanks

baumann@pan




1)标准C中没有strsep()这样的函数。 br />
2)要使用它,你必须做类似的事情:


char buf [] =" abcde";

char * p = buf;

char * q = strsep(& p," c");


HTH,
- g

-

Artie Gold - 德克萨斯州奥斯汀
http://it-matters.blogspot.com (12/5新帖)
http://www.cafepress。 com / goldsays



1) There is no such function as strsep() in standard C.
2) To use it, you''d have to do something like:

char buf[] = "abcde";
char *p = buf;
char *q = strsep(&p, "c");

HTH,
--ag
--
Artie Gold -- Austin, Texas
http://it-matters.blogspot.com (new post 12/5)
http://www.cafepress.com/goldsays


ba **** *****@gmail.com 写道:

大家好,

我想得到buf的地址,定义为

char buf [] =" abcde" ;;

所以可以调用
strsep(buf的地址,指向令牌的指针);

hi all,

i want to get the address of buf, which defined as

char buf[] = "abcde";

so can call
strsep(address of buf, pointer to token);




buf的地址是& buf。


strsep(& buf,指向令牌的指针);


指向字符串的指针是buf,

strsep(buf,指向令牌的指针);


....取决于关于你真正想要的东西。


-

pete



The address of buf is &buf.

strsep(&buf, pointer to token);

The pointer to the string is buf,

strsep(buf, pointer to token);

.... depending on what you really want.

--
pete


pete写道:
ba ********* @ gmail.com 写道:
ba*********@gmail.com wrote:
大家好,

我想得到buf的地址,定义为

char buf [] =" abcde" ;;
strsep(buf的地址,指向令牌的指针);

buf的地址是& buf。

strsep(& buf) ,指向令牌的指针);
hi all,

i want to get the address of buf, which defined as

char buf[] = "abcde";

so can call
strsep(address of buf, pointer to token);

The address of buf is &buf.

strsep(&buf, pointer to token);




这是真的 - 但没用,因为`buf''是不可变的。
指向字符串的指针是buf,

strsep(buf,指向令牌的指针);

...取决于你真正想要的东西。



That''s true -- but useless, as `buf'' is immutable.
The pointer to the string is buf,

strsep(buf, pointer to token);

... depending on what you really want.




[签名是:


char * strsep(char ** stringp,const char * delim);


--hence问题。]


--g

-

Artie Gold - 德克萨斯州奥斯汀
http://it-matters.blogspot.com (新帖子12/5)
http://www.cafepress.com/goldsays



[The signature is:

char *strsep(char **stringp, const char *delim);

--hence the problem.]

--ag
--
Artie Gold -- Austin, Texas
http://it-matters.blogspot.com (new post 12/5)
http://www.cafepress.com/goldsays


这篇关于我如何获得定义为char buf [] =" abcde&quot ;;的buf地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆