[Insight-users] Array of Pointers and Visual C++
(expected constant expression)
Karthik Krishnan
Karthik.Krishnan at kitware.com
Tue Feb 1 18:42:32 EST 2005
Hi Lagaffe,
Try replacing
SampleType::Pointer SRGSample[NumberOfRegions];
with
SampleType::Pointer *SRGSample = new SampleType::Pointer[NumberOfRegions];
Thanks
kk
Lagaffe wrote:
>Thanks kevin but it doesn't work ...
>another idea ?
>
>lagaffe
>
> --- "Kevin H. Hobbs" <kevin.hobbs.1 at ohiou.edu> a
>écrit :
>
>
>>What about
>> const int NumberOfRegions=myfuntion(...);
>>
>>
>>
>
>
>
>>ATTACHMENT part 2 application/pgp-signature
>>
>>
>name=signature.asc
> hello,
>
>I try to create an array of pointers at runtime using
>a function like:
>
>int NumberOfRegions=myfuntion(...);
>
>and then,
>
>typedef itk::Statistics::ListSample<
>MeasurementVectorType > SampleType;
>
>SampleType::Pointer SRGSample[NumberOfRegions];
>
>
>
>this code compile well with gcc but with visual C++ I
>have an error:
>
>error C2057: expected constant _expression
>
>
>
>Thanks for help
>
>
>
>
>
>
>
>
>Découvrez le nouveau Yahoo! Mail : 250 Mo d'espace de stockage pour vos mails !
>Créez votre Yahoo! Mail sur http://fr.mail.yahoo.com/
>_______________________________________________
>Insight-users mailing list
>Insight-users at itk.org
>http://www.itk.org/mailman/listinfo/insight-users
>
>
>
More information about the Insight-users
mailing list