Just got back in from the ice hockey and wanted to say thanks, it was me typing 'union' in that was causing the problems. I now have a suite of 4 programs that works. It may not be the best of...
Type: Posts; User: Cyber Kitten
Just got back in from the ice hockey and wanted to say thanks, it was me typing 'union' in that was causing the problems. I now have a suite of 4 programs that works. It may not be the best of...
Bigtamscot,
Referring to your posting on 30/1, the only problem I seem to have now is how to pass all_recs to a function. I've spent the entire morning looking throught the stage 3 folder and I...
Let me see if I can explain it any better.
char balance [10];
has read into it from a binary file 000010000, 9 characters and a null. So unlike your example there is no decimal place set in...
Sorry to be a pain, but how do you reference the structure if it is one of three in a union?
Anything like this?
struct record1{
char type;
char sort [7];
char part [21];
};
I've already tried
struct record{
char type = '\0';
char sort [7] = ' \0';
char part [21] = ' \0';
};
and I get 3 errors saying 'declaration missing ;'
On a sort of related topic - I am having a problem getting the correct figure printed from a file.
I read a record from a binary file into a structure as below:
struct record{
char name...
I'm trying to read one record at a time from a text file - putting the record, using strncpy, into a structure- then writing it to a binary file to be reused later as a binary file.
However, I'm...
This is probably very simple, but I need to know where I'm going wrong.
I have a structure and a binary file containing lots of records. I want to read one record from the file into the...
*g* I really must be stupid, but I don't have anyone else to talk to so humour the idiot!
Salem
void main() - this is what I was taught, tell me the other way and I will go away and look it up...
I give up!!
I have written a program that I thought would work. However, I have just spent the last 3 days trying to get it to work.
I don't like putting my entire program on, but I need someone...
I have a question!
The RECORD_DATA structure (for the stock master file(INDEXED)) is declared in the header file "ISAM.H", therefore can't you just write in your code:
RECORD_DATA *stock_rec
...
I have written a program which updates a master file using a transaction file and creates a new generation of the master file.
I ran the program and cannot get rid of 3 errors - can you give me any...
I have a structure into which I have wrote a record from a binary file
e.g.
struct customer{
char type;
float balance;
};
I am wanting to check if the type is I or R.
Oh, you are very good!!!!
I had forgotten to rewind the sortedfile_ptr.
It now prints.
Thankyou
Ooops!!
In typing my program into the compiler I missed a line (to read data into memory:- fread(m_ptr, REC_SIZE, no_of_recs, validfile_ptr)). Rather important really.
I agree completely, it...
The program should do what is already specified in my above postings, and then print the newly sorted file under appropriate headings. There are 134 records that should have been sorted.
I sat...
Nearly there - here's another question.
Say I not only need the program to sort the codes into order, I also need to sort any identical codes into order of 'type' (also common to all 3 records).
...
Excellent, I'm much less frustrated now.
However, saying that I'm stuck with malloc() - books just don't go far enough.
So far I have:
FILE *validfile_ptr;
cust_rec_st *cust_rec_ptr,...
Hi,
I'm still having problems with my program.
This is what the program should do:
There is a file which contains records which can be of 3 varying sizes. 'type' and 'code' are common to...
Help! I'm stuck & getting very frustrated, I have 2 questions.
A file contains records of 3 varying lengths, hence 3 structures and a union is used.
union a_rec{
struct a old;
...