Hi
can I writeto initialize every value of the array with 2?Code:int array[5]={2};
Hi
can I writeto initialize every value of the array with 2?Code:int array[5]={2};
It will only initialize the first element with 2. All other elements will be initialized with 0. As if you coded it as:
Code:int array[5] = { 2, 0, 0, 0, 0 };
Use a loop to assign the initial values.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
Copied, not moved. Both b1 and b2 will contain the same data. But be careful if your structure contains pointers, only the pointer will be copied the actual data will not be copied.Will all the values in b2 moved to b1?
You can get the data, but the data hasn't been copied. If I copy a treasure map, the treasure itself doesn't get copied...
Devoted my life to programming...