Try it.  The answer is 120.

-----Original Message-----
From: Baskin, Dave [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 26, 2001 2:28 PM
To: CF-Talk
Subject: Copying Structures Exam Question - is this right?


Hello, the following question was asked:

What would the following CFML code display to the user?
cfset Temp=StructNew()
cfset Temp["First"]=40
cfset Second=StructCopy(Temp)
cfset Second["First"]=80
cfoutput #Evaluate(Second["First"] + Temp["First"])# /cfoutput

my answer was 160, but according to the book, the answer is 120. I thought
(and it says in Forta's book) that a copy of a structure is just a pointer
to the original so that if you change the copy, you change the original. Am
i missing something here? Can someone explain? Thanks for any help.

d


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to