![]() |
Telelogic DOORS (steve huntington) | ![]() |
new topic :
profile :
search :
help :
dashboard :
calendar :
home
|
||
Latest News:
|
|
Topic Title: Louie's tidbit #3: String Vectors as Call Parameters Topic Summary: Created On: 6-Oct-2003 16:13 Status: Post and Reply |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
if you write function: bool NewResults(string &InString) you can modify the string variable InString and modifications are passed back to the calling program. If you do NOT put the "&" character, you can change InString but the calling program does NOT see the changes.
The reverse seems to be true for string Vectors: if you pass a string list of things to a calling function and want to modify the contents, do NOT use the "&" command: void SortString(string List[]). This is real confusing. This "feature" seems only to apply to STRING vectors, not other data types. Perhaps someone more fluent at "C" can respond with the reason behind this feature. - Louie |
|
![]() |
|
![]() |
|
Passing in string vectors already does the "Call by reference" (passing in the address of the string vector not a copy of it). Now I must say that it would make much more sense to me to be more consistent to pass strings and string vectors in the same manner but I didn't write the interpretor.
|
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.