Search:

Type: Posts; User: hughng92

Search: Search took 0.01 seconds.

  1. Replies
    7
    Views
    22,691

    I see. Also, how do I check whether my file...

    I see.
    Also, how do I check whether my file contains integers?


    if (fp == NULL ||(fscanf(fp, "%d",&array[count])!=1) ){
    count = (-1);
    return NULL;
  2. Replies
    7
    Views
    22,691

    So actually, fname will represent for whatever...

    So actually, fname will represent for whatever the name of the file I am going to pass in the function fopen() right?
    In my text_main.c, I have:


    #include <stdio.h>
    #include <stdlib.h>...
  3. Replies
    7
    Views
    22,691

    Hello WhiteFlags, Thank you for your response....

    Hello WhiteFlags,
    Thank you for your response. I am happy to explain myself.

    First, my bad for picking the name. I should have named fp as "fname" as in "file name".
    I think I did use size as...
  4. Replies
    7
    Views
    22,691

    Read integers from a file

    Hello,
    I am trying to read integer from a .txt file and then store the integers in the allocated array using malloc(). My thought is as following:


    int *read_text(char *fp, int *size);


    FILE...
  5. Replies
    1
    Views
    2,802

    Difference between two dates C++

    I am trying to solve a problem that asks me to give the total days between two dates. I have to take care of the some matters between those two dates such as leap years and the way of inputting the...
Results 1 to 5 of 5