so in this case, it creates a new data type "NUMBER" as an alias for "int number" and "int count".
so what about struct?
Type: Posts; User: muqing
so in this case, it creates a new data type "NUMBER" as an alias for "int number" and "int count".
so what about struct?
typedef struct
{
int number;
int count;
}NUMBER;
what does this mean?
I don't understand, where is four times coming from?
and to past one vaule, as "i" is increasing, it store "in" to different part of array,
like array[1], array[2] so on.
please help!
Thanks, so something like this?
int i, in;
Int *array;
do
{
Thanks for helping me tabstop
since the array size if determined by unknown input file, can I do something like this:
int i, in;
int[] array;
do
sorry, my mistake there.
so If I set up a int array,
and I use fscanf(infile, "%d", &in); to store into interger variable "in".
If The file didn't reach to the end if (!feof(infile))
...
so If I set a char array, what shoud i use to pass the vaule stored to "in" to that char array?
My assignment kinda asked me to use feof to check, basically fscanf just like scanf but takes a extra (first) parameter, maybe the input file only has 1 number, so that's why I have if...
This is the code I have so far, took me along time to learn from googling. so basically, I open the file, read it, pass to a array, then sort it.
It's long, so thanks for reading it.
...
hmm.. I don't know how to make count increment as I read the file.
If the program read a list of number and store to a char array called "instr"
Can I do : int count =...
Hey everyone,
I'm a program newbie, I'm writing a code for sorting numbers from a input file,
basically, I ask user to type in the file name, open file, read it, pass to a array, then sort it...