<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Bonjour,<br>
Je cherche à retourner un tableau d'int depuis une fonction C,<br>
mais malgré les exemples le tableau retourné ne contient que des<br>
valeurs qui semblent incohérentes.<br>
<br>
Peut-être pourrez vous voir ce que je rate.<br>
<br>
Merci.<br>
<br>
<small><small><small>void LFSR( int seq[], int * stage, int * taps,
int * start_value) {<br>
int size;<br>
int lfsr;<br>
int i;<br>
size = (2^(*stage))-1;<br>
lfsr = *start_value;<br>
<br>
for(i = 0; i < size; i++) {<br>
seq[i] = 1;<br>
}<br>
}<br>
</small></small></small><br>
=================================================<br>
<pre style="font-family:Monospaced;font-style:normal;font-size:12.0;"><span style="color:rgb(174,92,176);text-decoration:underline;">ilib_for_link</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(188,143,143);">'</span><span style="color:rgb(188,143,143);">LFSR</span><span style="color:rgb(188,143,143);">'</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(188,143,143);">'</span><span style="color:rgb(188,143,143);">lfsr.c</span><span style="color:rgb(188,143,143);">'</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(74,85,219);">[</span><span style="color:rgb(74,85,219);">]</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">c</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(74,85,219);">)</span>
<span style="color:rgb(50,185,185);">exec</span> <span style="color:rgb(188,143,143);">loader.sce</span>
<span style="color:rgb(176,24,19);">function</span> <span style="color:rgb(131,67,16);font-weight:bold;">PRN</span><span style="color:rgb(92,92,92);">=</span><span style="color:rgb(0,0,0);text-decoration:underline;">LFSR</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(131,67,16);font-weight:bold;">stage</span><span style="color:rgb(0,0,0);">, </span><span style="color:rgb(131,67,16);font-weight:bold;">taps</span><span style="color:rgb(0,0,0);">, </span><span style="color:rgb(131,67,16);font-weight:bold;">init_value</span><span style="color:rgb(74,85,219);">)</span>
<span style="color:rgb(0,0,0);">seq_size</span> <span style="color:rgb(92,92,92);">=</span> <span style="color:rgb(188,143,143);">2</span><span style="color:rgb(92,92,92);">^</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(131,67,16);font-weight:bold;">stage</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(92,92,92);">-</span><span style="color:rgb(188,143,143);">1</span><span style="color:rgb(0,0,0);">;</span>
<span style="color:rgb(0,0,0);">seq</span><span style="color:rgb(92,92,92);">=</span><span style="color:rgb(50,185,185);">call</span><span style="color:rgb(74,85,219);">(</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">LFSR</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(131,67,16);font-weight:bold;">stage</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(188,143,143);">2</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">i</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(131,67,16);font-weight:bold;">taps</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(188,143,143);">3</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(188,143,143);">"</span><span style="color:rgb(1
88,143,143);">i</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(131,67,16);font-weight:bold;">init_value</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(188,143,143);">4</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">i</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">out</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(74,85,219);">[</span><span style="color:rgb(188,143,143);">1</span><span style="color:rgb(0,0,0);">,</span><span style="color:rgb(0,0,0);">seq_size</span><span style="color:rgb(74,85,219);">]</span><span style="color:rgb(0,0,0);">,</span> <span style="color:rgb(188,143,143);">1</span><span style="color:rgb(
0,0,0);">,</span> <span style="color:rgb(188,143,143);">"</span><span style="color:rgb(188,143,143);">i</span><span style="color:rgb(188,143,143);">"</span><span style="color:rgb(74,85,219);">)</span><span style="color:rgb(0,0,0);">;</span>
<span style="color:rgb(131,67,16);font-weight:bold;">PRN</span><span style="color:rgb(92,92,92);">=</span><span style="color:rgb(0,0,0);">seq</span><span style="color:rgb(0,0,0);">;</span>
<span style="color:rgb(176,24,19);">endfunction</span></pre>
<br>
</body>
</html>