Need help in a c programme


 
Thread Tools Search this Thread
Top Forums Programming Need help in a c programme
# 1  
Old 02-14-2008
Need help in a c programme

Dear Friends,

I ve two text files like
re_im.dat
Code:
  13.7663000000         5.9572200000
  10.2682000000        10.9345000000
  5.0810700000        14.1132000000

two real values per row
Sarf.dat
Code:
127 128 128 128  71 0
128 128 128 128  71 0
128 128 128 128  71 0

This is having 6 unsigned values per row.

I ve function in c which does some calculation depending on these inputs
from the above two file

The first two arguments to my c function are input from the file re_im.dat,
next 6 values to the function are from file Sarf.dat

the next two arguments to the function are output from that function to another function .

My problem is to read values and send as a pointer to the function..

The function is as below..

Code:
#include <stdio.h>
#include <math.h>

typedef unsigned int U;
typedef struct {U c; U d;} vec32;

void rf_model(double *input_re, double *input_im, vec32 *lsts, vec32 *vgagain, vec32 *dcout1i,\
 vec32 *dcout1q, vec32 *dcout2i, vec32 *dcout2q, double *adc_input_re, double *adc_input_im){

}

If my explanation is not clear pls let me know ..

need help badly..

regards,
Prady
# 2  
Old 02-26-2008
Quote:
Originally Posted by user_prady
My problem is to read values and send as a pointer to the function..
Hey,
Where do you read in those values? Can you print them (using prinf()), so you can be sure?
If the problem really is that you don't know how to read those values, check the function fscanf() or fgets().

Regards,
ElJavi
# 3  
Old 02-29-2008
Quote:
Originally Posted by user_prady
Dear Friends,

I ve two text files like
re_im.dat
Code:
  13.7663000000         5.9572200000
  10.2682000000        10.9345000000
  5.0810700000        14.1132000000

two real values per row
Sarf.dat
Code:
127 128 128 128  71 0
128 128 128 128  71 0
128 128 128 128  71 0

This is having 6 unsigned values per row.

I ve function in c which does some calculation depending on these inputs
from the above two file

The first two arguments to my c function are input from the file re_im.dat,
next 6 values to the function are from file Sarf.dat

the next two arguments to the function are output from that function to another function .

My problem is to read values and send as a pointer to the function..

The function is as below..

Code:
#include <stdio.h>
#include <math.h>

typedef unsigned int U;
typedef struct {U c; U d;} vec32;

void rf_model(double *input_re, double *input_im, vec32 *lsts, vec32 *vgagain, vec32 *dcout1i,\
 vec32 *dcout1q, vec32 *dcout2i, vec32 *dcout2q, double *adc_input_re, double *adc_input_im){

}

If my explanation is not clear pls let me know ..

need help badly..

regards,
Prady
Well, you could read the files with fscanf() and then store the values in to some array, which you can pass to your function.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

programme is ok but not working in script

hi buddies; i have a very strange problem. i made a script composed of just 5 line. it is containing awk and nawk codes and it is working perfectly when it is applied one-by-one (copy & paste). but when i type run myscript.mos, it is giving: nawk: syntax error at source line 1 context is... (5 Replies)
Discussion started by: gc_sw
5 Replies

2. Programming

Help for coding this programme

for a floating-point array x whose size is n, find the geometric mean.. GM =n x1.x2.x3...xn (2 Replies)
Discussion started by: allyjaah
2 Replies

3. Programming

starting programme in C

hello, For school i make the next mission: give how many chambers in a constant number. use an array which chamber is free and count how many chamber there are free. make also something to test I don't now how to start. I need an well example so i can make the mission thank you (1 Reply)
Discussion started by: wouter88
1 Replies

4. Programming

help with C programme to lock remote resources

hello every one i am working on a project to lock remote computer resources(hard drive, usb, cd- rom, folder etc). i have maintained connection using JAVA RMI and using JAVA JNI to lock resources, now i am really stuck up with C programme to do actual locking, i am using RHL-5 on admin computer... (7 Replies)
Discussion started by: zius_oram
7 Replies

5. Programming

cobol programme

I have some compile programme .crn now I want to run .crn programme on express cobol which allow only *.gnt programme any solution to run *.crn programme (0 Replies)
Discussion started by: bibi
0 Replies

6. Programming

How to call the C Programme in UNIX shell scripting...?

Hi All, How to call the C programme in UNIX shell scripting? please send me some sample script for the above scenario. Regards, MPS:b: (1 Reply)
Discussion started by: psiva_arul
1 Replies

7. Shell Programming and Scripting

snmpget in a perl programme

Hi Guyz can u tell me how to write a programme in perl using snmpget. Regards' Harrr (0 Replies)
Discussion started by: Harikrishna
0 Replies

8. What is on Your Mind?

Certification Programme for Unix Shell Scripting

Hi All, Can any one know about "Certification Programme for Unix Shell Scripting"? How do I become Certified Unix shell scripting programmer? Where will I get this certification? How do I continue my career as a script programmer? What are the additional things to learn. Currently I know... (14 Replies)
Discussion started by: ganapati
14 Replies

9. Shell Programming and Scripting

want to use output of c programme in expect

hi i am having a c code which gives the output of my password in text format i.e when i run my c code which which gives the password asfollows====>>>>>> $./passwdprogram ======>>>>>>abc@123(this is the output) now i have an expect script to remotely ssh which uses the password set in ... (0 Replies)
Discussion started by: xander
0 Replies

10. UNIX for Dummies Questions & Answers

Unable to compile the c programme in unix

Hi, My name is vreddy and I am learning c language now and written one programme on vi editor. how do I compile the programme please give me some advice and that would be helpfull for me. thanks vre (10 Replies)
Discussion started by: vasudeva
10 Replies
Login or Register to Ask a Question