D:/GR/UnrealProjects/J199 4.27/Source/J199/byte2Data.h(17) : Error: Arrays aren't allowed as function parameters
时间: 2023-07-07 10:31:20 浏览: 51
这个错误通常是因为在函数的参数中使用了数组。在 C++ 中,通常不能直接将数组作为函数的参数传递,而需要使用指针或引用来代替。
例如,如果你想要传递一个数组作为参数,可以将其声明为指针,例如:
```
void myFunction(int* myArray, int arraySize);
```
或者使用引用,例如:
```
void myFunction(int (&myArray)[10]);
```
这样就可以避免这个错误了。
相关问题
D:/GR/UnrealProjects/J199 4.27/Source/J199/byte2Data.h(17) : LogCompile: Error: Type 'uint16' is not supported by blueprint. bytesToUInt.ReturnValue
这个错误通常是因为你在蓝图中使用了一个不支持的类型,例如 `uint16`,而蓝图只支持一部分 C++ 类型。
如果你需要在蓝图中使用 `uint16` 类型,可以将其转换为一个蓝图支持的类型,例如 `int32` 或 `float`。
例如,你可以将 `uint16` 转换为 `int32`,例如:
```c++
int32 myValue = static_cast<int32>(myUInt16Value);
```
或者,你可以将 `uint16` 转换为 `float`,例如:
```c++
float myValue = static_cast<float>(myUInt16Value);
```
这样就可以避免这个错误了,让你的代码在蓝图中正常使用。
D:/GR/UnrealProjects/J199 4.27/Source/J199/byte2Data.h(17) : Error: Inappropriate '*' on variable of type 'uint8', cannot have an exposed pointer to this type.
这个错误通常是因为你尝试在一个类型为 `uint8` 的变量上使用指针,而 `uint8` 类型不能直接暴露指针。
如果你需要在函数中传递 `uint8` 类型的变量,你可以考虑将其声明为指针或引用类型,或者将其包装在一个结构体中。
例如,你可以将其声明为指针类型:
```
void myFunction(uint8* myVariable);
```
或者,你可以将其包装在一个结构体中:
```
struct MyStruct
{
uint8 myVariable;
};
void myFunction(MyStruct& myStruct);
```
这样就可以避免这个错误了。