• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 181
  • Last Modified:

Struct

Hi!

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.


thanks
0
jpcs
Asked:
jpcs
1 Solution
 
AlexVirochovskyCommented:
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.
0
 
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.

0
 
sumant032199Commented:
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.
0
Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

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

Alex : jsantos98@usa.net
0
 
AlexVirochovskyCommented:
Ok, done.
0
 
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
0
 
AlexVirochovskyCommented:
Ok, i am very glad to help you.
Alex
0

Featured Post

Live webcast with Pinal Dave

Pinal Dave will teach you tricks to help identify the real root cause of database problems rather than red herrings. Attendees will learn scripts that they can use in their environment to immediately figure out their performance Blame Shifters and fix them quickly.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now