Boost logo

Boost :

From: zlf (zlfcn_at_[hidden])
Date: 2005-05-05 05:10:32


Hi all,
    What is the easiest way to assign mulitply value for a defined number
array?

    Assigning mulitply elements' value when defining like this will be OK.
        int test [ 2 ] = { 1 , 2 };

    If I want to assign value for the number array [test] after defining it.
I only know I can achieve this by the following step.

        int test [ 2 ];
        test [ 0 ] = 1;
        test [ 1 ] = 2;

    [int test [ 2 ]; test = { 1 , 2 };] seems easy and reasonable. But
executing it will get a compile error. What is the easiest way to assign
mulitply value for a defined number array? Thx

zlf


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk