Hello all!
So basically I start off with one array, then I run a function that takes 3 floats, puts those 3 floats into a temporary array, then it returns this new temporary array and where I call this fucntion, It looks like this:
float array [] = { 0, 0, 0 ];
float ArrayFunction( float num1, float num2, float num3 )
{
float temparray [] = { 1.0, 2.0, 3.0 };
return temparray;
}
main...
array = FunctionName( num1, num2, num3 );
To me, this looks perfect, exactly what I wanted it to do, but to C++, this is code filled with errors:
1>c:\users\anton\downloads\bug-fixes-2009-07-11\opengl 3.0\chapter_1\simple\src\main.cpp(57) : error C2440: 'return' : cannot convert from 'float [3]' to 'float'
1> There is no context in which this conversion is possible
1>c:\users\anton\downloads\bug-fixes-2009-07-11\opengl 3.0\chapter_1\simple\src\main.cpp(61) : error C2109: subscript requires array or pointer type
1>c:\users\anton\downloads\bug-fixes-2009-07-11\opengl 3.0\chapter_1\simple\src\main.cpp(62) : error C2109: subscript requires array or pointer type
1>c:\users\anton\downloads\bug-fixes-2009-07-11\opengl 3.0\chapter_1\simple\src\main.cpp(63) : error C2109: subscript requires array or pointer type
1>c:\users\anton\downloads\bug-fixes-2009-07-11\opengl 3.0\chapter_1\simple\src\main.cpp(66) : warning C4244: 'argument' : conversion from 'double' to 'GLfloat', possible loss of data
1>c:\users\anton\downloads\bug-fixes-2009-07-11\opengl 3.0\chapter_1\simple\src\main.cpp(68) : warning C4244: 'argument' : conversion from 'double' to 'GLfloat', possible loss of data
1>c:\users\anton\downloads\bug-fixes-2009-07-11\opengl 3.0\chapter_1\simple\src\main.cpp(68) : warning C4244: 'argument' : conversion from 'double' to 'GLfloat', possible loss of data
1>c:\users\anton\downloads\bug-fixes-2009-07-11\opengl 3.0\chapter_1\simple\src\main.cpp(70) : warning C4244: 'argument' : conversion from 'double' to 'GLfloat', possible loss of data
1>c:\users\anton\downloads\bug-fixes-2009-07-11\opengl 3.0\chapter_1\simple\src\main.cpp(70) : warning C4244: 'argument' : conversion from 'double' to 'GLfloat', possible loss of data
1>c:\users\anton\downloads\bug-fixes-2009-07-11\opengl 3.0\chapter_1\simple\src\main.cpp(82) : error C2440: '=' : cannot convert from 'float' to 'float [3]'
1> There are no conversions to array types, although there are conversions to references or pointers to arrays
1>c:\users\anton\downloads\bug-fixes-2009-07-11\opengl 3.0\chapter_1\simple\src\main.cpp(83) : error C2664: 'CreateTriangle' : cannot convert parameter 1 from 'float [3]' to 'float'
1> There is no context in which this conversion is possible
Anyone have an idea of what's going on?
Thanks in advance for any replies, Anton