C语言函数返回值不能直接写数组

时间:2014-02-13 00:37:28   收藏:0   阅读:444

C语言返回值不能直接写数组

#ifndef _VMATH_H
#define  _VMATH_H


#ifdef _cplusplus
extern "C" {
#endif

typedef float Matrix44f[16];

Matrix44f translate(float x, float y, float z);
Matrix44f scale(float x, float y, float z);

Matrix44f rotateX(float radian);
Matrix44f rotateY(float radian);
Matrix44f rotateZ(float radian);
Matrix44f rotateXYZ(float radian, float x, float y, float z); 

Matrix44f perspectiveFrustum( float left, float right, float top, float bottom, float near, float far); //透视投影
Matrix44f orthoPerspect( float left, float right, float top, float bottom, float near, float far);  //正交投影

#ifdef _cplusplus
}
#endif
#endif

如上写法编译器会报错,可改为指针类型.


float *translate(float x, float y, float z);


原文:http://blog.csdn.net/lelieven/article/details/19118751

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!