Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 12-16-2003, 04:53 AM   #1
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
Registered: May 2002
Posts: 964

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

Original Poster
Rep: Reputation: 15
my structs are:

typedef struct Graph *graph;

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

typedef struct No *no;

typedef struct _No{
  char *name;
  char value;

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



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.


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 > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:53 AM.

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