# Thread: Problems passing values from function to main variables

1. Originally Posted by matsp
And for most cases, the CORRECT solution.
That's why it also says "and generally best"...are you trying to misquote me?

This reminds me of a story I heard once about three gunslingers in a darkened closet...maybe it was two gunslingers and a grizzly bear*.

* I think the punchline was "WHAT HAPPENED TO THE NEW G'DAM CAT?"

2. Well, I arrived to this:

Code:
```#include <stdio.h>

float SV(float dog[12][3])
{
int i,j;
for(i=0;i<12;i++)
{
{ for(j=0;j<3;j++)
printf("dog %8.3f\t", dog[i][j]);
}
printf("\n");
}

return **dog;
}

int main()
{
float cat[12][3]={
{-4.859,0.073,0.122},
{-3.610,-0.654,0.017},
{-2.432,0.308,0.088},
{-2.621,1.515,0.217},
{-1.213,-0.231,0.004},
{-0.016,0.584,0.061},
{1.100,-0.061,-0.749},
{1.157,-1.283,-0.869},
{1.989,0.764,-1.306},
{3.095,0.267,-2.100},
{3.942,1.426,-2.607},
{3.646,2.585,-2.327},
};

float mouse[12][3];
int i,j;

for(i=0;i<12;i++)
for(j=0;j<3;j++)
mouse[i][j]=0;

**mouse=SV(cat);

for(i=0;i<12;i++)
{
{ for(j=0;j<3;j++)
printf("mouse %8.3f\t", mouse[i][j]);
}
printf("\n");
}

return 0;
}```
This only prints the first element, [0][0].
can you please tell what am I doing wrong?