Click here to Skip to main content
16,007,885 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: sigh. still not working. Pin
MAAK13-May-03 22:07
MAAK13-May-03 22:07 
GeneralGot it! Pin
Bigsteiny14-May-03 16:18
Bigsteiny14-May-03 16:18 
GeneralAdding to dialogue design palette Pin
Trollslayer12-May-03 5:31
mentorTrollslayer12-May-03 5:31 
GeneralRe: Adding to dialogue design palette Pin
G. Steudtel12-May-03 6:05
G. Steudtel12-May-03 6:05 
QuestionTLB's need to be registered ?? Pin
Braulio Dez12-May-03 5:28
Braulio Dez12-May-03 5:28 
AnswerRe: TLB's need to be registered ?? Pin
Anonymous13-May-03 16:13
Anonymous13-May-03 16:13 
GeneralWinINet Via Proxy Pin
thowra12-May-03 5:09
thowra12-May-03 5:09 
GeneralErrors Pin
flora_k12-May-03 4:50
flora_k12-May-03 4:50 
Hi,

I am still learning programming in C. I have tried to write down a piece of code and i get many errors.
Could someone help me to correct those? Hope i am not asking too much
Thx



/*******************************************************************************************

this code shows the Trl_values calculation. it is going to help determining the histogram


********************************************************************************************/

#include <stdio.h>
#include <math.h>
double tailing = NULL;
double trl_values = NULL;
double y_int_1 = NULL;
double rest = NULL;
double leading = NULL;
double Duration;
const double slice_level = 53.9998;
double histogram_ram = NULL;
double i_index;
double Trl_values;
void trl_calculation(int amount, unsigned char*pData)
{

for (int i=1; i <= amount; i++)
{
if ((y_int_1) - slice_level <0) & (y_int - slice_level > 0)
tailing = 1 - (y_int-slice_level)/(y_int-y_int_1);
Trl_values(length(Trl_values)+1) = tailing + leading + rest;
leading = 1 - tailing;
rest = 0;
else if ((y_int_1-slice_level>0)&(y_int-slice_level<0))
tailing = 1 - (y_int-slice_level)/(y_int-y_int_1);
Trl_values(length(Trl_values)+1) = tailing + leading + rest;
leading = 1 - tailing;
rest = 0;
else
rest = rest + 1;

y_int_1 = y_int;

}
}



void histogram(int amount, unsigned char*pData)
{
for (int i=1; i <= amount; i++)
{
i_index=round(Trl_values(i)/Duration)+1;
histogram_ram(i_index)=histogram_ram(i_index)+1;

}
}

P.S: How do i express the "round" function in C?

F.K
GeneralRe: Errors Pin
flora_k12-May-03 4:53
flora_k12-May-03 4:53 
GeneralRe: Errors Pin
G. Steudtel12-May-03 5:11
G. Steudtel12-May-03 5:11 
GeneralRe: Errors Pin
David Crow12-May-03 5:11
David Crow12-May-03 5:11 
GeneralRe: Errors Pin
Iain Clarke, Warrior Programmer12-May-03 5:13
Iain Clarke, Warrior Programmer12-May-03 5:13 
GeneralSpinControl Help Pin
VanHlebar12-May-03 4:45
VanHlebar12-May-03 4:45 
GeneralRe: SpinControl Help Pin
Iain Clarke, Warrior Programmer12-May-03 5:05
Iain Clarke, Warrior Programmer12-May-03 5:05 
GeneralRe: SpinControl Help Pin
VanHlebar12-May-03 16:25
VanHlebar12-May-03 16:25 
GeneralRe: SpinControl Help Pin
VanHlebar12-May-03 16:26
VanHlebar12-May-03 16:26 
GeneralDynamic loading of buttons Pin
JensB12-May-03 4:33
JensB12-May-03 4:33 
GeneralRe: Dynamic loading of buttons Pin
David Crow12-May-03 4:38
David Crow12-May-03 4:38 
GeneralRe: Dynamic loading of buttons Pin
JensB12-May-03 4:43
JensB12-May-03 4:43 
GeneralRe: Dynamic loading of buttons Pin
David Crow12-May-03 5:06
David Crow12-May-03 5:06 
GeneralRe: Dynamic loading of buttons Pin
basementman12-May-03 5:23
basementman12-May-03 5:23 
GeneralRe: Dynamic loading of buttons Pin
David Crow12-May-03 5:56
David Crow12-May-03 5:56 
GeneralCPropertySheet Pin
RalfPeter12-May-03 4:23
RalfPeter12-May-03 4:23 
GeneralRe: CPropertySheet Pin
JensB12-May-03 4:30
JensB12-May-03 4:30 
GeneralRe: CPropertySheet Pin
David Crow12-May-03 4:36
David Crow12-May-03 4:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.