B
bpascal123
Hi,
I'm learning how to use functions.
Could someone take a quick look at this code below and help me
understand this line :
Sum((float*)T, 3, 4) );
I can't figure out (float*) ... is it float *T ? I understand float is
telling the type of T which is an array but why "*" at the end ? When
it's declared it says *A, there I understand but on calling the
function Sum I then get confuse.
Thanks if you can bring me some light,
Pascal
#include <stdio.h>
main()
{
float Sum(float *A, int N, int M);
float T[3][4] = {{1, 2, 3, 4},
{5, 6, 7, 8},
{9,10,11,12}};
printf("Sum of : %f \n",
Sum((float*)T, 3, 4) );
return 0;
}
I'm learning how to use functions.
Could someone take a quick look at this code below and help me
understand this line :
Sum((float*)T, 3, 4) );
I can't figure out (float*) ... is it float *T ? I understand float is
telling the type of T which is an array but why "*" at the end ? When
it's declared it says *A, there I understand but on calling the
function Sum I then get confuse.
Thanks if you can bring me some light,
Pascal
#include <stdio.h>
main()
{
float Sum(float *A, int N, int M);
float T[3][4] = {{1, 2, 3, 4},
{5, 6, 7, 8},
{9,10,11,12}};
printf("Sum of : %f \n",
Sum((float*)T, 3, 4) );
return 0;
}