How do I modify an array that is a parameter to a function?

Is this code right?

You need to mark the Array argument as a reference as right now it is actually a copy of the callers one.

void UBFL_TArray:: RemoveInvalidObjectFromArray(TArray<UObject*> &Array)

Now I have more question.
In fact, IsValid may not only be used to judge, so can I write it like this?

Take a look at TArray::RemoveAll.

One example of how to use it How do i remove items from a TArray while iterating? - #2 by Br_P_d

Like you do with the other arrays, there is no difrence.
The array is on the parameter so you do what you normally do with a function, call it and insert values on the function that you are calling.

Somewhere outside the function, in another function.
function_name(parameter value);
it can have strange things, the parameter call.

parameter value can be anything, from the loop system to other variables or direct values. Of course to get anywhere inside the array you have to count inside of it or specify a position inside of the array

then of course you must call it again, this time to get values off of it if you wish.

You can call the array anyway if you have it declared in your header file with the function I think, even if it’s on the parameter, without calling maybe the function.

You can call it by it’s name without a function call I think, you should try.
Array_name = your sintax here;
This can be inside the function with your array as param.

You don’t need to use .Add, it’s not obligatory , there are other forms of adding as well like above.

Since it has it as a parameter tho I think you should try to insert values inside of it by calling the function.

If you are trying to add, it’s rather element.Add. Not Add(element)

What are you doing you put the array name as the value of the array to be inserted. It looks like you are removing items.

So you can do this if you want to add, Array_name.Add(value to be added inside the array here);
But this just adds in a clandestine way, from start position to the next and so on, it’s for when the array is mostly empty, each add will mostly add to the last position where the previous one left off, if it’s filled already, you risk overwriting data, especially if you declrared an array size.

You said modify, so the Add operator does not modify but add new data.
You should drop the .Add stuff and learn modern C++ where you control the position where you modify data, or a whole section of the array made possible with a loop.