The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > High Level Programming
Google UNIX.COM


High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
snmpget in a perl programme Harikrishna Shell Programming and Scripting 0 04-10-2008 02:59 AM
want to use output of c programme in expect xander Shell Programming and Scripting 0 06-13-2007 09:36 AM
Unable to compile the c programme in unix vasudeva UNIX for Dummies Questions & Answers 10 12-01-2006 01:58 PM
Help, How to add secondary IP addr to eth0, by programme? pcman High Level Programming 2 07-16-2006 07:05 PM
porting a unix programme to linux??what matters prasoon UNIX for Advanced & Expert Users 1 11-11-2005 07:17 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 02-14-2008
Registered User
 

Join Date: Sep 2007
Posts: 163
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
Reply With Quote
Forum Sponsor
  #2  
Old 02-26-2008
Registered User
 

Join Date: Dec 2007
Location: Diest, BE
Posts: 6
Quote:
Originally Posted by user_prady View Post
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
Reply With Quote
  #3  
Old 02-29-2008
Registered User
 

Join Date: Feb 2008
Posts: 2
Quote:
Originally Posted by user_prady View Post
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.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 12:57 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0