reading data from stdin to structures

K

kittu_phani

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

Thomas Matthews

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

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
 
C

Chris Dollin

kittu_phani said:
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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top