<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:14pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;" dir="ltr">
<p>Dear friends,</p>
<p><br>
</p>
<p>I am having trouble to correctly implement the possibility of various numbers of channels in caen_v7nn.c.</p>
<p><br>
</p>
<p>For example in INIT_FAST, I wanted to change </p>
<p><br>
</p>
<p><span style="font-size: 10pt;">uint16_t threshold_array[32];</span><br>
</p>
<p><span><br>
</span></p>
<p><span>to</span></p>
<p><span><br>
</span></p>
<p><span></p>
<div><span style="white-space: normal; font-size: 10pt;">uint16_t* threshold_array;</span></div>
<div><span style="white-space: normal; font-size: 10pt;">threshold_array = calloc(a_v7nn->number_of_channels, sizeof(uint16_t));</span></div>
<br>
</span>
<p></p>
<p>However, at some points in the code, the length of the array is determined by something like</p>
<p><br>
</p>
<p><span style="font-size: 10pt;">sizeof array / sizeof array[0]</span></p>
<p><br>
</p>
<p>and this fails if we just have the pointer.</p>
<p><br>
</p>
<p>I found some explanations and possible solutions here: <a href="https://stackoverflow.com/questions/37538/how-do-i-determine-the-size-of-my-array-in-c" class="OWAAutoLink">https://stackoverflow.com/questions/37538/how-do-i-determine-the-size-of-my-array-in-c</a></p>
<p><br>
</p>
<p>However, I assume this is much too complicated and I should just try to implement this differently. Maybe this issue came already up for some other module and was solved long time ago.</p>
<p><br>
</p>
<p>Could you give me a hint?</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<p>Thank you very much!</p>
<p><br>
</p>
<p><br>
</p>
<p>Best greetings</p>
<p>Günter</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<div id="Signature">
<div style="font-family:Tahoma; font-size:13px"></div>
</div>
</div>
</body>
</html>