# String array doesnt work within a shared funtion library

**URL:** <https://forums.unrealengine.com/t/string-array-doesnt-work-within-a-shared-funtion-library/323355>\
**Category:** Editor Scripting\
**Tags:** arrays, UE4-7, unreal-engine, functions, UE4, question, Blueprint\
**Created:** [June 28, 2015, 7:56pm UTC](https://forums.unrealengine.com/t/string-array-doesnt-work-within-a-shared-funtion-library/323355 "2015-06-28T19:56:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_1859f0201](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_1859f0201](https://forums.unrealengine.com/u/anonymous_user_1859f0201)\
**Post date:** [June 28, 2015, 7:56pm UTC](https://forums.unrealengine.com/t/string-array-doesnt-work-within-a-shared-funtion-library/323355/1 "2015-06-28T19:56:17Z")

</div>

**Problem:** I cant get it to ether store or give me the information inside the string arrays. Is this not possible within a function? Or is it some sort of glitch. But when i call to get information from the string it prints out blank.

**What the code does(If needed):**  
I’m having an issue with my item system. I’m trying to make an item system that stores items based off id then ill have a function library that stores any item information that is needed that can be access by giving the correct id.

**Extra Information(Probably not needed):**

The properties function input has nothing to do with the problem.

I’m using unreal engine 4.7.6 because 4.8.1 and 4.8.0 crashes on start up and corrupted my game already and i had to rebuild

 ![48255-funtion+problem.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/c/4/2/c42ed3d1516ce2195ca0777ebeeb0ae86b28a937.png)

---

<div class="post-metadata">

**Author:** ![ScottSpadea](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/scottspadea/32/1194682_2.png) [@ScottSpadea](https://forums.unrealengine.com/u/ScottSpadea)\
**Post date:** [June 29, 2015, 5:27am UTC](https://forums.unrealengine.com/t/string-array-doesnt-work-within-a-shared-funtion-library/323355/2 "2015-06-29T05:27:31Z")

</div>

have you tested if it works with single strings, instead of string arrays?

using local Variables inside a function, to store long term data, seems strange to me. in c++, local Variable data goes out of scope when the function ends. if you want to mix data and functions, usually you would use an Actor Blueprint. if you just want to store data, maybe you should use a CSV dataTable.

local variables are supposed to be temporary storage that only exists while the function is running.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_1859f0201](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_1859f0201](https://forums.unrealengine.com/u/anonymous_user_1859f0201)\
**Post date:** [June 30, 2015, 12:16am UTC](https://forums.unrealengine.com/t/string-array-doesnt-work-within-a-shared-funtion-library/323355/3 "2015-06-30T00:16:09Z")

</div>

Yah i suppose it would be better to do that. I’m more use to code so it weird getting into visual scripting. so i was experimenting with a way i could organize a large amount of data that any actor in the world can call from. But i still need to remember its translated from visual scripting to c++ code. In my mind i though that it was creating a string like  
`string Item_Names[5] = {"wood", "1", "2". "3", "4" };`  
But my guess is that the get node is getting confused because a string is really an array and that would be storing a pointer to a array in a string.  
`char Item_Names[5][10];` so if i writes it like this in c++ it might get confused.

---

<div class="post-metadata">

**Author:** ![Etemadi\_1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Etemadi\_1](https://forums.unrealengine.com/u/Etemadi_1)\
**Post date:** [June 30, 2015, 12:49am UTC](https://forums.unrealengine.com/t/string-array-doesnt-work-within-a-shared-funtion-library/323355/4 "2015-06-30T00:49:47Z")

</div>

Maybe save the strings outside of the function and call them when use the function this way your array can exist.

Next time check the code if you don’t know exactly. You can right mouse and go to source code
