strlen不赞成?!? [英] strlen deprecated ?!?

查看:78
本文介绍了strlen不赞成?!?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




(我意识到这可能不是正确的组合 - 可能

有人指示我到相应的团队发表这个问题? - 谢谢

!)
我正在使用Visual C ++ 2005 Express Edition Beta(从MS免费下载 -

万岁!),一切正常,除了我收到警告回来使用

的某些函数,strlen()例如,说函数已经

已弃用 - 虽然它们仍然可以使用(我猜这是为什么它是一个警告

而不是错误!)。


有没有人有任何想法哪个字符串函数(以及最近似乎已经弃用的其他函数?)MS希望我们在使用

编译器时使用它们?


提前致谢,


马特

解决方案



Matt Parkins写道:



(我是真的这可能不是正确的组合 -
有人会指示我到相应的小组发布这个问题吗? -
谢谢!)

我正在使用Visual C ++ 2005 Express Edition Beta(从MS
免费下载 - 万岁!),一切正常,除了我收到警告回到
使用一些函数,例如strlen(),说函数有
已被弃用 - 尽管它们仍然可以工作(我猜这是为什么它的
警告而不是错误!)。

有没有人知道哪些字符串函数(和其他函数
似乎最近已被弃用)MS希望我们在使用他们的
时使用它们编译器?

提前致谢,

Matt




请改用strnlen。或者更好的是,std :: string有一个length()方法。

-shez-




shez写道:

Matt Parkins写道:



(我意识到这可能不是正确的组合这个 - 可以

有人指示我到相应的小组发布这个问题吗? -


感谢

!)
我正在使用Visual C ++ 2005 Express Edition Beta(免费下载



MS -

万岁!),一切正常,除了我收到一些函数的使用

的警告,例如strlen(),说函数



已经< blockquote class =post_quotes>已弃用 - 虽然它们仍然可以工作(我猜它为什么


a警告

而不是错误!)。

有没有人知道哪个字符串函数(和其他


函数

似乎有最近被弃用了)MS希望我们在使用

他们的编译器时使用吗?

提前致谢,

Matt



使用strnlen代替。或者更好的是,std :: string有一个length()



方法。 -shez -



如果你不知道字符串的长度怎么用?'strnlen''

这是一个很大的好处''strlen''。假设您要将

字符缓冲区连接到streambuf;你怎么找到长度? / david




" Matt Parkins" <无********** @ idontthinksomyfriend.com> schrieb im

Newsbeitrag新闻:S6 ******************* @ fe2.news.blueyonder.co。英国...



(我意识到这可能不是正确的组合 -
有人可以指导我到相应的小组发表这个
问题? - 谢谢!)

我正在使用Visual C ++ 2005 Express Edition Beta(免费下载来自MS - 万岁!),一切正常,除了我收到关于某些函数的使用的警告,例如strlen(),说
函数已被弃用 - 虽然它们仍然可以工作(这是
我想为什么它是一个警告,而不是错误!)。

有没有人知道哪些字符串函数(和其他似乎最近被弃用的函数)MS想要
我们在使用他们的编译器时使用?

提前致谢,

Matt




我想MS想要你使用:

_tcslen,_tcsstr,_tcscpy,_tcscat,_tcsanything ...

-Gernot


Hi,

(I realise this probably isn''t precisely the right group for this - could
someone direct me to the appropriate group to post this question? - thanks
!)

I''m using Visual C++ 2005 Express Edition Beta (free download from MS -
hooray!), and everything works fine, except I get warnings back on the use
of some functions, strlen() for example, saying that the function has been
deprecated - although they do still work (which is I guess why its a warning
and not an error!).

Does anyone have any idea which string functions (and other functions that
seem to have recently been deprecated) MS would like us to use when using
their compiler ?

Thanks in advance,

Matt

解决方案


Matt Parkins wrote:

Hi,

(I realise this probably isn''t precisely the right group for this - could someone direct me to the appropriate group to post this question? - thanks !)

I''m using Visual C++ 2005 Express Edition Beta (free download from MS - hooray!), and everything works fine, except I get warnings back on the use of some functions, strlen() for example, saying that the function has been deprecated - although they do still work (which is I guess why its a warning and not an error!).

Does anyone have any idea which string functions (and other functions that seem to have recently been deprecated) MS would like us to use when using their compiler ?

Thanks in advance,

Matt



Use strnlen instead. Or better yet, std::string has a length() method.
-shez-



shez wrote:

Matt Parkins wrote:

Hi,

(I realise this probably isn''t precisely the right group for this - could

someone direct me to the appropriate group to post this question? -


thanks

!)

I''m using Visual C++ 2005 Express Edition Beta (free download from


MS -

hooray!), and everything works fine, except I get warnings back on the use

of some functions, strlen() for example, saying that the function


has been

deprecated - although they do still work (which is I guess why its

a warning

and not an error!).

Does anyone have any idea which string functions (and other

functions that

seem to have recently been deprecated) MS would like us to use when using

their compiler ?

Thanks in advance,

Matt



Use strnlen instead. Or better yet, std::string has a length()


method. -shez-


How can you use ''strnlen'' if you don''t know the length of the string?
This is a great benefit of ''strlen''. Suppose you want to connect a
character buffer to a streambuf; how would you find the length? /david



"Matt Parkins" <no**********@idontthinksomyfriend.com> schrieb im
Newsbeitrag news:S6*******************@fe2.news.blueyonder.co. uk...

Hi,

(I realise this probably isn''t precisely the right group for this -
could someone direct me to the appropriate group to post this
question? - thanks !)

I''m using Visual C++ 2005 Express Edition Beta (free download from
MS - hooray!), and everything works fine, except I get warnings back
on the use of some functions, strlen() for example, saying that the
function has been deprecated - although they do still work (which is
I guess why its a warning and not an error!).

Does anyone have any idea which string functions (and other
functions that seem to have recently been deprecated) MS would like
us to use when using their compiler ?

Thanks in advance,

Matt



I guess MS wants you to use:
_tcslen, _tcsstr, _tcscpy, _tcscat, _tcsanything...
-Gernot


这篇关于strlen不赞成?!?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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