[ale] Stupid question

Michael Kachline kachline at compgen.com
Mon Oct 29 18:52:24 EST 2001


On Mon, 29 Oct 2001, Christopher Fowler wrote:

> I though of using one big buffer and storying everything there.  I would
> know the exact locations
> of everything.
> 
> Problem.
> 
> If my int is at 1 and hostname is 2-33 (32 bytes) , how to I access that
> easily.
<snip>

	Chris,

	Use a struct instead of a big (char *) buffer to hold and store
your config settings. Is it important that your config file be ascii only?
Even still, a struct should work, so long that all elements of the struct
are char's (or other structs which are based solely on chars). Use fread()
and fwrite() (or even just read() and write()) to read / write your struct
from config file.

						- Mike
--------------------------------------------------------------------
 Michael Kachline
 Systems Programmer

 Phone - Desk:   404-705-2848
 Phone - Mobile: 678-231-9367
 Phone - Home:   706-367-0874
 Fax: 404-705-2805
 Web: http://www.intec-telecom-systems.com
 Email: Michael.Kachline at intec-telecom-systems.com

 Intec Telecom Systems
 Building G, 4th Floor                      
 5775 Peachtree-Dunwoody Road            
 Atlanta, GA  30342
--------------------------------------------------------------------


---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be 
sent to listmaster at ale dot org.






More information about the Ale mailing list