LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 12-16-2003, 04:53 AM   #1
afrm
LQ Newbie
 
Registered: Oct 2003
Location: Portugal
Distribution: rh9
Posts: 27

Rep: Reputation: 15
reading data from a file


i got a file which has many data and i need to read it into fields of a Graph struct in an effective way, this means i dont want to be waiting 1hour :P
Each line of the file has info about a node in the Graph. (i hope u know whats a graph struct )
if i read it from the top to the bottom, well i might have some core dumps or have to wait 1h .. so i need u to post some suggestions in order to solve this prob. tks
 
Old 12-16-2003, 06:43 AM   #2
jim mcnamara
Member
 
Registered: May 2002
Posts: 964

Rep: Reputation: 34
We can help if you post the code you already have.
 
Old 12-16-2003, 07:43 PM   #3
afrm
LQ Newbie
 
Registered: Oct 2003
Location: Portugal
Distribution: rh9
Posts: 27

Original Poster
Rep: Reputation: 15
my structs are:

Code:
typedef struct Graph *graph;

typedef struct Graph{
  Porta x;
  int **adj;
}Graph;

typedef struct No *no;

typedef struct _No{
  char *name;
  char value;
}No;

typedef struct _portaLogica{
  float delayTime;
  no **input;
  no *output;
  char *function;
  int num_inputs;
}Porta;
The file is something like :

inputs
...
.....

outputs
.....
.....

nor delayTime output num_inputs input1 input2 input-n
nand delayTime output num_inputs input1 input2 input-n
.....
......
.....

/* well its a logic simulator so u see nand, nor .. etc */

Last edited by afrm; 12-16-2003 at 07:46 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reading audio data files as an actual audio file? Erik_the_Red Linux - Software 1 06-01-2005 07:22 AM
reading data from a serial port mchitrakar Linux - Networking 3 12-04-2004 01:24 PM
Reading comma-separated data from file MeLassen Programming 4 04-04-2004 02:41 PM
Reading data from file (field organizzation) eiem Programming 1 03-29-2004 05:03 AM
Reading COM Port Data croakofonix Programming 1 06-11-2003 04:17 PM


All times are GMT -5. The time now is 05:06 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration