Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic DOORS (steve huntington)
Decrease font size
Increase font size
Topic Title: Array Assignment
Topic Summary: assign array = array
Created On: 28-Jul-2006 13:11
Status: Post and Reply
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Quick Reply Quick Reply
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 28-Jul-2006 13:11
User is offline View Users Profile Print this message


Thomas Langholz

Posts: 40
Joined: 20-Oct-2005

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
how can i fix it?

greez

thomas

Report this to a Moderator Report this to a Moderator
 28-Jul-2006 14:05
User is offline View Users Profile Print this message


Tony Goodman

Posts: 1098
Joined: 12-Sep-2002

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
Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic DOORS forum.
There are currently 1 users logged in.
The most users ever online was 15 on 15-Jan-2009 at 16:36.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.