Search:

Type: Posts; User: 574515

Search: Search took 0.01 seconds.

  1. Replies
    11
    Views
    756

    Thank you for your answer! I will try to do that....

    Thank you for your answer! I will try to do that. My struct has 4 char arrays (array1[20]...) and 1 int, no pointers or anything.
  2. Replies
    11
    Views
    756

    Thank you for your help! I've done that and now I...

    Thank you for your help! I've done that and now I get error "stream.valid()" when trying to read. Read code:


    FILE* open_F = NULL;open_F = fopen("myfile.bin", "rb");
    if (open_F == NULL) {
    ...
  3. Replies
    11
    Views
    756

    Thank you, I've corrected that, but my original...

    Thank you, I've corrected that, but my original error still persists. I need to write a number of members in a file, overall number, not 1st, 2nd etc. If file doesn't exist I need to make a new file...
  4. Replies
    11
    Views
    756

    This is checking if file exists, if not, creating...

    This is checking if file exists, if not, creating and writing 1 (as in 1st member) at the beginning (or so I thought).


    int x = 1;
    FILE* open_F = NULL;
    open_F = fopen("myfile.bin",...
  5. Replies
    11
    Views
    756

    Hello, thank you for your resposne. Fwrite()...

    Hello,

    thank you for your resposne. Fwrite() for me writes (and fread() reads) something random (like 8k+ something or -8k something).
  6. Replies
    11
    Views
    756

    Working with binary files

    Hello,

    I've got an assignment to write a program that keeps track of a library (small one, nothing too great or polished) and to be saved as binary. I have a struct for members, and entering /...
  7. Writing your own functions (particularly getchar())

    Hello,
    I have seen people writing / rewriting some predefined or "included" functions and I need to make one similar to getchar() but instead of [enter] it takes [space]. Was looking around internet...
  8. Replies
    5
    Views
    799

    Thank you very much for your response. I will...

    Thank you very much for your response. I will look into it. I'm still trying to advance, since my classes are going "slower" and I'm reading books about C and trying to find online "problems" to...
  9. Replies
    5
    Views
    799

    I quoted a problem. I said that I've done first...

    I quoted a problem. I said that I've done first part with input n and printing it out. I've just put "logic" that I was thinking so far about counting consonants in days. It's easier for me to make...
  10. Replies
    5
    Views
    799

    Reversing an array and printing it out

    I've found a "problem" online. Text goes:



    I had no problem with first part, but the last is one that bothers me. If I initialize an array of 7 elements (days) how do I check for number of...
  11. I've tried changing it and it was as Salem said....

    I've tried changing it and it was as Salem said. Well, I'm still learning, and our courses are going slowly. We haven't had any proper assignments yet, so I'm "winging" it on my own. Thank you for...
  12. No, I did not. I haven't gotten any errors. I'm...

    No, I did not. I haven't gotten any errors. I'm using Visual Studio 2019. And I do check for errors and warning messages. The only warning message I got was that types differ, since fopen returns int...
  13. Found the solution! Thank you for taking your...

    Found the solution! Thank you for taking your time and looking here!


    if (fCreate = fopen(e_F_Name, "r") == NULL) {
    printf("File with given name already exists.\n");
    system("pause");
    ...
  14. STURCT: typedef struct date_Of_Birth { ...

    STURCT:

    typedef struct date_Of_Birth {
    short int day;
    short int month;
    short int year;
    }DATE;

    typedef struct student {
    int pin;
  15. Beginner with C: Problem with textual files

    Hello,
    I'm trying to write a program for my assignment. I'm using STRUCTS and fprintf for writing in a file. Problem: I have main screen with choices, like, create (text file with student info),...
Results 1 to 15 of 15