Help... I need a C++ code....

Joined
May 17, 2008
Messages
1
Reaction score
0
hello....

I need a c++ code that read a log file and compute the average....

This is a sample of the log file....


**********************************************************
Input vector # 99:
OUTPUT: 0 1 0 1 0
**** Vdd = 1.8 **** Tclk = 0.1 ****
SER(FIT): 1.1e-002 1.1e-002 1.9e-002 1.1e-002 5.2e-003



**********************************************************
Input vector # 100:
OUTPUT: 0 1 1 0 0
**** Vdd = 1.8 **** Tclk = 0.1 ****
SER(FIT): 7.6e-003 1.3e-002 1.2e-002 1.5e-002 5.2e-003


I need to compute the horizontal sum of the SER(FIT)values and then compute the average of the sums....

i.e( I want to compute [1.1e-002 + 1.1e-002 +1.9e-002 + 1.1e-002 + 5.2e-003] for each input vector and then compute the average of the sums)...


I can't read the output file and convert the string to a number (since it contains numbers & letters). Instead, I should read the number, then check (using a for loop) where is the position of the letter 'e', and finally construct the number from the string by multiplying the number before the letter 'e' with 10^(number after letter 'e')...

So HOW i could do this?!!

Thanks in advance...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,263
Messages
2,571,064
Members
48,769
Latest member
Clifft

Latest Threads

Top