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;
Type: Posts; User: hughng92
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;
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>...
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...
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...
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...