Added lib 'coords.c'

This commit is contained in:
arcan1s
2013-07-14 23:57:59 +04:00
parent 9ccd3e79e6
commit 109bf5612a
9 changed files with 3670 additions and 215 deletions

30
stat_new/test/test_0.c Normal file
View File

@ -0,0 +1,30 @@
#include <stdio.h>
#include <stdlib.h>
int test_func(float* test)
{
int i, j;
*test = 3.0;
return 0;
}
int main (int argc, char *argv[])
{
int i, j;
float test;
test = 0.0;
printf ("%3.1f\n", test);
printf ("Done\n");
test_func(&test);
printf ("%3.1f\n", test);
return 0;
}

35
stat_new/test/test_1.c Normal file
View File

@ -0,0 +1,35 @@
#include <stdio.h>
#include <stdlib.h>
int test_func(float *test)
{
int i, j;
for (i=0; i<3; i++)
test[i] = i;
printf("\n%lf\n", test[1]);
return 0;
}
int main (int argc, char *argv[])
{
int i, j;
float test[3];
for (i=0; i<3; i++)
test[i] = 0.0;
for (i=0; i<3; i++)
printf ("%3.1f\n", test[i]);
printf ("Done\n");
test_func(test);
for (i=0; i<3; i++)
printf ("%3.1f\n", test[i]);
return 0;
}

38
stat_new/test/test_2.c Normal file
View File

@ -0,0 +1,38 @@
#include <stdio.h>
#include <stdlib.h>
int test_func(int **test)
{
int i, j;
for (i=0; i<3; i++)
for (j=0; j<3; j++)
test[i][j] = 3;
return 0;
}
int main (int argc, char *argv[])
{
int i, j;
int test[3][3];
for (i=0; i<3; i++)
for (j=0; j<3; j++)
test[i][j] = 0;
for (i=0; i<3; i++)
for (j=0; j<3; j++)
printf ("%i\n", test[i][j]);
printf ("Done\n");
test_func((int **) test);
for (i=0; i<3; i++)
for (j=0; j<3; j++)
printf ("%i\n", test[i][j]);
return 0;
}

37
stat_new/test/test_2.cpp Normal file
View File

@ -0,0 +1,37 @@
#include <stdio.h>
#include <stdlib.h>
int test_func(int (&test)[3][3])
{
int i, j;
for (i=0; i<3; i++)
test[i][i] = 3;
return 0;
}
int main (int argc, char *argv[])
{
int i, j;
int test[3][3];
for (i=0; i<3; i++)
for (j=0; j<3; j++)
test[i][j] = 0;
for (i=0; i<3; i++)
for (j=0; j<3; j++)
printf ("%i\n", test[i][j]);
printf ("Done\n");
test_func(test);
for (i=0; i<3; i++)
for (j=0; j<3; j++)
printf ("%i\n", test[i][j]);
return 0;
}