Valarray /指向第一个元素的指针 [英] Valarray/Pointer to first Element
问题描述
Hello Group,
有一些std :: valarray的memberfunc返回指向数组中第一个元素的指针。我该如何使用它?很多。
HAND Chris
Hello Group,
there is some memberfunc for std::valarray to return a pointer to the
first element in the array. How do i use this? Thanx a lot.
HAND Chris
推荐答案
11月2日上午10:43,Chris Forone < 4 ... @ gmx.atwrote:
On Nov 2, 10:43 am, Chris Forone <4...@gmx.atwrote:
Hello Group,
std ::有一些memberfunc :: valarray返回指向数组中
第一个元素的指针。我该如何使用它?很多。
HAND Chris
Hello Group,
there is some memberfunc for std::valarray to return a pointer to the
first element in the array. How do i use this? Thanx a lot.
HAND Chris
纠正我,如果我错了,但我不相信任何标准容器有
方法给你一个指向任何内容的指针,正确
所以。你可以得到它的参考。为什么你想要一个指向
第一个元素的指针?你假设它的元素是什么类型的?如何使用
而不是参考?
Correct me if I am wrong, but I don''t believe any std container has
methods to give you a pointer to any of thier contents, and rightly
so. You can get a reference to it. Why would you want a pointer to the
first element? What type are you assuming its elements are? How would
you use it opposed to a reference?
2007-11-02 16:43,Chris Forone写道:
On 2007-11-02 16:43, Chris Forone wrote:
Hello Group,
std :: valarray有一些memberfunc返回指向
数组中的第一个元素。我该如何使用它?非常感谢。
Hello Group,
there is some memberfunc for std::valarray to return a pointer to the
first element in the array. How do i use this? Thanx a lot.
& val [0];
其中val是valarray。
- -
Erik Wikstr ?? m
&val[0];
Where val is a valarray.
--
Erik Wikstr??m
Christopher写道:
Christopher wrote:
11月2,10:43 am,Chris Forone< 4 ... @ gmx.atwrote:
On Nov 2, 10:43 am, Chris Forone <4...@gmx.atwrote:
> Hello Group,
那里是std :: valarray的一些memberfunc,用于返回指向数组中第一个元素的指针。我该如何使用它?很多。
HAND Chris
>Hello Group,
there is some memberfunc for std::valarray to return a pointer to the
first element in the array. How do i use this? Thanx a lot.
HAND Chris
纠正我,如果我错了,但我不相信任何标准容器有
方法给你一个指向任何内容的指针,正确
所以。你可以得到它的参考。
Correct me if I am wrong, but I don''t believe any std container has
methods to give you a pointer to any of thier contents, and rightly
so. You can get a reference to it.
你可以得到所有元素的地址。
you can get the address of all the elements.
为什么你想要指向
第一元素?
Why would you want a pointer to the
first element?
为什么不呢?例如,应用std库算法。指向
指向valarray元素的指针是随机访问迭代器。
why not? For example, to apply the std library algorithms. A pointer to
an element of a valarray is a random-access iterator.
您假设其元素是什么类型?
What type are you assuming its elements are?
好吧,例如,对于valarray< double>,我希望加倍。 :)
well, for example, for a valarray<double>, I would expect double. :)
你如何使用它而不是参考?
How would
you use it opposed to a reference?
一件事是参考,另一件事是指针。
问候,
Zeppe
one thing is a reference, another thing is a pointer.
Regards,
Zeppe
这篇关于Valarray /指向第一个元素的指针的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!