QUICK C PROGRAMMING QUESTION

Kenji4861

Banned
Jan 28, 2001
2,821
0
0
All I'm trying to do is to create a file which is 8mega bytes. I'm looking through reference books and I can see how to create a file, but not specify the size.

Also, I need to be able to write to it.. such as first 32 bits to be this, 2nd 32bit's to be something else, etc. How can I go about doing that?

Thanks for any suggestions!
 

johnjbruin

Diamond Member
Jul 17, 2001
4,401
1
0
==============
filedescriptor = open (file)
char array[4]="lala"

for 1 to whatever
write(filedescriptor, array, 4)

close (filedescriptor)
=============

basic idea

do a man on any *nix machine to see how open, write and close work