Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > reading data from stdin to structures

Reply
Thread Tools

reading data from stdin to structures

 
 
kittu_phani
Guest
Posts: n/a
 
      07-24-2003

Iam very much new to C-programing.Please give the silution for
following problem.
How to read data from stdin to array ofstructures

--
Posted via http://dbforums.com
 
Reply With Quote
 
 
 
 
Thomas Matthews
Guest
Posts: n/a
 
      07-24-2003
kittu_phani wrote:
> Iam very much new to C-programing.Please give the silution for
> following problem.
> How to read data from stdin to array ofstructures
>
> --
> Posted via http://dbforums.com


There are many ways to do this. Depends on whether
the data is in ASCII or binary. The binary solution
may depend on Endianism.

Write a function to read in a structure. Call this
function for each structure in the array.

Structures can be read either as a whole unit or
each field read individually.

Without more information, it is hard to get more
specific. Try reading the FAQ below. If you need
help, post your code and indicate how it is failing
and where the problem is.

See also:
fread
fscanf
fgets

--
Thomas Matthews

C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html

 
Reply With Quote
 
 
 
 
Chris Dollin
Guest
Posts: n/a
 
      07-24-2003
kittu_phani wrote:

> Iam very much new to C-programing.Please give the silution for
> following problem.
> How to read data from stdin to array ofstructures


So, how far through K&R 2 are you?

--
Chris "electric hedgehog" Dollin
C FAQs at: http://www.faqs.org/faqs/by-newsgrou...mp.lang.c.html
C welcome: http://www.angelfire.com/ms3/bchambl...me_to_clc.html
 
Reply With Quote
 
 
 
Reply

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
peek at stdin, flush stdin Johnathan Doe C Programming 5 5 Days Ago 04:30 PM
How to pass stdin of a C++ program to the stdin of a process createdwith ShellExecute() Ben C Programming 2 08-29-2009 09:47 PM
Reading from stdin then launching a program that reads from stdin strange behaviour Stefano Sabatini Perl Misc 6 07-29-2007 10:38 PM
structures, structures and more structures (questions about nestedstructures) Alfonso Morra C Programming 11 09-24-2005 07:42 PM
Reading stdin once confuses second stdin read Charlie Zender C Programming 6 06-21-2004 01:39 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57