![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Array Assignment Topic Summary: assign array = array Created On: 28-Jul-2006 13:11 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
hi,
i want to assign an array to an array it looks like this: real widthArr[] = widthTableCR[] in fact it is executable, but i get an err-mess: -R-E- DXL: <src/Format_WEXP.dxl:105> array bounds exceeded () Backtrace: <Line:173> -I- DXL: execution halted |
|
![]() |
|
![]() |
|
You can directly assign vectors, but this does NOT make a copy of the original, it makes the second point to the first. The following example illustrates this:
int arr1[] = { 1, 2, 3, 4 } int arr2[] arr2 = arr1 // print from arr2 print arr2[2] "" // change arr1 arr1[2] = 7 // print from arr2 again print arr2[2] "" If you want arr2 to have the same values as arr1, then you need to assign each element individually. You must also check that the array sizes are the same. ------------------------- Tony Goodman http://www.smartdxl.com |
|
![]() |
Telelogic DOORS
» DXL Exchange
»
Array Assignment
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.