Re: Data Files
Xarky wrote:[color=blue]
>[/color]
.... snip ...[color=blue]
>
> In my file I need to store the following (mainly for a small
> database):
> int position;
> char *data;
> int check;
>
> Also I have to add the data mentioned at EOF or sometimes randomly
> at any position in the file, or delete at any position. Can this
> be done.[/color]
Modify your fundamental item to something like:
union ptrthing {
struct item *itemptr;
long int fileposn;
};
enum location {INMEM, ONDISK, DELETED};
struct item {
int position
enum location where;
union ptrthing *data;
int check;
};
and you have a chance of implementing something that can be moved
to and from disk storage.
--
fix (vb.): 1. to paper over, obscure, hide from public view; 2.
to work around, in a way that produces unintended consequences
that are worse than the original problem. Usage: "Windows ME
fixes many of the shortcomings of Windows 98 SE". - Hutchison
Xarky wrote:[color=blue]
>[/color]
.... snip ...[color=blue]
>
> In my file I need to store the following (mainly for a small
> database):
> int position;
> char *data;
> int check;
>
> Also I have to add the data mentioned at EOF or sometimes randomly
> at any position in the file, or delete at any position. Can this
> be done.[/color]
Modify your fundamental item to something like:
union ptrthing {
struct item *itemptr;
long int fileposn;
};
enum location {INMEM, ONDISK, DELETED};
struct item {
int position
enum location where;
union ptrthing *data;
int check;
};
and you have a chance of implementing something that can be moved
to and from disk storage.
--
fix (vb.): 1. to paper over, obscure, hide from public view; 2.
to work around, in a way that produces unintended consequences
that are worse than the original problem. Usage: "Windows ME
fixes many of the shortcomings of Windows 98 SE". - Hutchison
Comment