Search:

Type: Posts; User: muqing

Search: Search took 0.00 seconds.

  1. Thread: typedef struct

    by muqing
    Replies
    3
    Views
    1,331

    so in this case, it creates a new data type...

    so in this case, it creates a new data type "NUMBER" as an alias for "int number" and "int count".

    so what about struct?
  2. Thread: typedef struct

    by muqing
    Replies
    3
    Views
    1,331

    typedef struct

    typedef struct
    {
    int number;
    int count;
    }NUMBER;


    what does this mean?
  3. Thread: Help with qsort

    by muqing
    Replies
    18
    Views
    3,627

    I don't understand, where is four times coming...

    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!
  4. Thread: Help with qsort

    by muqing
    Replies
    18
    Views
    3,627

    Thanks, so something like this? int i, in;...

    Thanks, so something like this?



    int i, in;

    Int *array;

    do
    {
  5. Thread: Help with qsort

    by muqing
    Replies
    18
    Views
    3,627

    Thanks for helping me tabstop since the array...

    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
  6. Thread: Help with qsort

    by muqing
    Replies
    18
    Views
    3,627

    sorry, my mistake there. so If I set up a int...

    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))
    ...
  7. Thread: Help with qsort

    by muqing
    Replies
    18
    Views
    3,627

    so If I set a char array, what shoud i use to...

    so If I set a char array, what shoud i use to pass the vaule stored to "in" to that char array?
  8. Thread: Help with qsort

    by muqing
    Replies
    18
    Views
    3,627

    My assignment kinda asked me to use feof to...

    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...
  9. Thread: Help with qsort

    by muqing
    Replies
    18
    Views
    3,627

    This is the code I have so far, took me along...

    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.


    ...
  10. Thread: Help with qsort

    by muqing
    Replies
    18
    Views
    3,627

    hmm.. I don't know how to make count increment as...

    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 =...
  11. Thread: Help with qsort

    by muqing
    Replies
    18
    Views
    3,627

    Help with qsort

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