# ARRAY\_COUNT fails on array passed to method

**URL:** <https://forums.unrealengine.com/t/array-count-fails-on-array-passed-to-method/368795>\
**Category:** C++\
**Tags:** tarray, unreal-engine, question, CPP\
**Created:** [August 30, 2016, 9:36pm UTC](https://forums.unrealengine.com/t/array-count-fails-on-array-passed-to-method/368795 "2016-08-30T21:36:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_d4efcd70](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_d4efcd70](https://forums.unrealengine.com/u/anonymous_user_d4efcd70)\
**Post date:** [August 30, 2016, 9:36pm UTC](https://forums.unrealengine.com/t/array-count-fails-on-array-passed-to-method/368795/1 "2016-08-30T21:36:52Z")

</div>

I’m trying to figure out why ARRAY\_COUNT works when the array is created within a method, but not when it is passed to the method.

This compiles:

```
TArray<FName> ValArr;
FName Temp[] = { TEXT("10"), TEXT("20")};
ValArr.Append(Temp, ARRAY_COUNT(Temp));

```

But this doesn’t:

```
ABaseDialogue::DialogueNodes::DialogueNodes(FText dialogueFragment, FName nextNodes [])
{
	DialogueFragment = dialogueFragment;
	NextNodes.Append(nextNodes, ARRAY_COUNT(nextNodes));
}

```
