Code:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
float fonction(float[][24]);
float rayonnementJour(int, float*);
float vsr[12] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};
int i, h;
int main()
{ float mat[12][24];
fonction(mat);
i = 0;
do
{
for(h = 0; h < 24; h++)
{
printf(" %f ", mat[i][h]);
}
printf("\n");
i += 1;
}while(i < 13);
system("PAUSE");
return 0;
}
float fonction(float mat[][24])
{
for(i = 0; i < 12; i++)
{
rayonnementJour(i, mat[i]);
}
}
float rayonnementJour(int i,float *heureptr)
{
*heureptr + 5;
for(h = 6; h < 19; h++)
{
*heureptr = 2 * vsr[i];
*heureptr + 1;
}
}
The output:
2.000000 1.#QNAN0 7867456191839611200000000000000000.000000 0.000000 0.0000
00 0.000000 0.000000 0.000000 0.000000 537752089363777560000000000000000000
0.000000 0.000000 6020158900724676900000000000000000000.000000 60558914358439
10300000000000000000000.000000 -1.#QNAN0 6056156374819358000000000000000000000
.000000 6068373991304357700000000000000000000.000000 0.000000 1.#QNAN0 1.#QN
AN0 6068420894376566100000000000000000000.000000 0.000000 0.000000 0.000000
0.000000
4.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 6070641818228166000
000000000000000000.000000 0.000000
6.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
0.000000 6070613929914960900000000000000000000.000000 0.000000 6070400964614
122600000000000000000000.000000 0.000000 1.#QNAN0 0.000000 60704187117225258
00000000000000000000.000000 0.000000 0.000000 0.000000 0.000000 0.000000 6
308463212035783600000000000000000000.000000 0.000000 0.000000
8.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 537731490
0415238500000000000000000000.000000 0.000000 0.000000 0.000000 0.000000 0.0
00000 0.000000 0.000000 6024231862103210200000000000000000000.000000 0.00000
0 0.000000 6024231862103210200000000000000000000.000000 0.000000 0.000000 0
.000000 0.000000 0.000000
10.000000 0.000000 6020158900724676900000000000000000000.000000 602423566505
5010900000000000000000000.000000 -1.#QNAN0 0.000000 6026566874508830600000000
000000000000.000000 6024186860506902100000000000000000000.000000 0.000000 0.0
00000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 6020158900724
676900000000000000000000.000000 6024235665055010900000000000000000000.000000 -
1.#QNAN0 6024231862103210200000000000000000000.000000 602414629568769480000000
0000000000000.000000 6024186860506902100000000000000000000.000000 0.000000 80
37033551211060100000000000000000.000000
12.000000 0.000000 0.000000 6018216226179827200000000000000000000.000000 53
47049742334789500000000000000000000.000000 -1.#QNAN0 7889934088102935500000000
000000000.000000 0.000000 0.000000 0.000000 0.000000 0.000000 534707572917
2094200000000000000000000.000000 -1.#QNAN0 7889934088102935500000000000000000.
000000 0.000000 0.000000 0.000000 5573104803271088800000000000000000000.0000
00 0.000000 0.000000 5658224371949913800000000000000000000.000000 7889934088
102935500000000000000000.000000 0.000000
14.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 54947620
94701083800000000000000000000.000000 7889934088102935500000000000000000.000000
0.000000 0.000000 0.000000 0.000000 920466.125000 0.000000 0.000000 0.00
0000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
16.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
18.000000 0.000000 0.000000 6023926992133855400000000000000000000.000000 0.
000000 6023944739242258600000000000000000000.000000 0.000000 0.000000 0.0000
00 1.#QNAN0 0.000000 0.000000 -0.000000 0.000000 0.000000 0.000000 0.000
000 -0.000000 0.000000 0.000000 0.000000 -0.000000 0.000000 0.000000
20.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
0.000000 0.000000 0.000000 6024190029633402700000000000000000000.000000 0.
000000 0.000000 0.000000 0.000000
22.000000 0.000000 6020158900724676900000000000000000000.000000 602394664071
8158900000000000000000000.000000 -1.#QNAN0 60239447392422586000000000000000000
00.000000 7900452864616743400000000000000000.000000 0.000000 0.000000 790045
5959466841600000000000000000.000000 0.000000 0.000000 0.000000 7924809334889
683200000000000000000.000000 7834164889333129100000000000000000.000000 -1.#QNA
N0 7900601417421457600000000000000000.000000 0.000000 0.000000 0.000000 792
4809334889683200000000000000000.000000 7834150034052657700000000000000000.00000
0 -1.#QNAN0 7900455959466841600000000000000000.000000
24.000000 0.000000 0.000000 0.000000 7937818227792513600000000000000000.000
000 0.000000 1.#QNAN0 1.#QNAN0 0.000000 0.000000 0.000000 786688426354146
1400000000000000000.000000 0.000000 0.000000 0.000000 0.000000 0.000000 -1
.#QNAN0 0.000000 0.000000 7988459878919600000000000000000000.000000 0.000000
0.000000 0.000000
0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000
0.000000 0.000000 1.#QNAN0 -222775059167508960000.000000 0.000000 0.000000
0.000000 0.000000 0.000000 0.000000 0.000000 -0.000000 60188950530762494
00000000000000000000.000000 5376595508699609000000000000000000000.000000 -1.#Q
NAN0 0.000000
Press any key to continue . . .
somthing went terribly wrong.....
Code:
float rayonnementJour(int i,float *heureptr)
{
*heureptr += 5;
for(h = 6; h < 19; h++)
{
*heureptr = 2 * vsr[i];
*heureptr++;
}
}
is my pointer arrithmetic right? Im trying to modifie colum 6 to 18 for every row...
should i start a new thread?