• C



Please help me with this :

I need to use a binary file with this structure :

Name : string : 30 chars
Age : Integer

How to add to the file one record
How to remove ... p.e. The second (after 4 inserted)
and how to change ... p.e The first.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Wer don't make you homework instead of you! Send you code and wer can help,descuss, fix errors, but you homework you must make youself.
jpcsAuthor Commented:
sorry, but no homework...

I can even start, because I tried to use the samples I have in my book "CGI programming in the WWW", but they use pointers, and I don't understand that much.

I can simply give you some suggestions but no code. fread() is a function which
reads a specified number of equal-sized data items from an input stream into a block. It works on binary files.
What were the top attacks of Q1 2018?

The Threat Lab team analyzes data from WatchGuard’s Firebox Feed, internal and partner threat intelligence, and a research honeynet, to provide insightful analysis about the top threats on the Internet. Check out our Q1 2018 report for smart, practical security advice today!

Use fseek to set the position in the file. the position is (n-1)*sizeof(struct)
If you have problems with pointers, i can send you tutorial about this(write you EMail).
jpcsAuthor Commented:
Thanks but, I need an example.

Alex : jsantos98@usa.net
Ok, done.
jpcsAuthor Commented:
Hi everyone!

I've finally solved my problem thanks to the tuturial ginven from Alex. I'll give him the points.

Thanks Alex
Ok, i am very glad to help you.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.