首页 > 解决方案 > 在 C++ 中打印 float3& 值

问题描述

这可能是一个非常微不足道的问题,但我通过函数获取参数

bool intersectRaySphere(const float3& p, const float3& d, const float3& c, float r, float& t)

现在我必须使用其中的几个参数。所以我尝试以不同的方式打印 float3&c 的值,例如

float my_value = c[2];
std::cout << "SphereCenter: " <<  my_value << std::endl;

但是我每次都会遇到编译器错误......我该如何正确地做到这一点?

标签: c++

解决方案


推荐阅读