Search:

Type: Posts; User: Cyber Kitten

Search: Search took 0.00 seconds.

  1. Replies
    16
    Views
    18,717

    Just got back in from the ice hockey and wanted...

    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...
  2. Replies
    16
    Views
    18,717

    Bigtamscot, Referring to your posting on 30/1,...

    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...
  3. Replies
    7
    Views
    7,832

    Let me see if I can explain it any better. ...

    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...
  4. Replies
    16
    Views
    18,717

    Sorry to be a pain, but how do you reference the...

    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];
    };
  5. Replies
    16
    Views
    18,717

    I've already tried struct record{ char...

    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 ;'
  6. Replies
    7
    Views
    7,832

    char to float

    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...
  7. Replies
    16
    Views
    18,717

    Convert a text file to a binary file

    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...
  8. Replies
    2
    Views
    1,965

    Reading a binary file

    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...
  9. Replies
    5
    Views
    1,296

    *g* I really must be stupid, but I don't have...

    *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...
  10. Replies
    5
    Views
    1,296

    Problem Program

    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...
  11. Replies
    6
    Views
    1,758

    I have a question! The RECORD_DATA structure...

    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
    ...
  12. Replies
    2
    Views
    1,204

    structures & data types

    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...
  13. Replies
    1
    Views
    1,223

    Structures & Comparing

    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.
  14. Oh, you are very good!!!! I had forgotten to...

    Oh, you are very good!!!!
    I had forgotten to rewind the sortedfile_ptr.
    It now prints.

    Thankyou
  15. Ooops!! In typing my program into the compiler I...

    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...
  16. Why won't it work?

    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...
  17. Same program

    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).
    ...
  18. Excellent, I'm much less frustrated now. ...

    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,...
  19. Using malloc() & qsort with a union revisited

    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...
  20. Replies
    2
    Views
    5,805

    Using malloc() & qsort with a union

    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;
    ...
Results 1 to 20 of 20