Search:

Type: Posts; User: ljin

Search: Search took 0.00 seconds.

  1. Replies
    7
    Views
    2,286

    Guess so... how come will that happen?

    Guess so... how come will that happen?
  2. Replies
    7
    Views
    2,286

    it still wont work.

    it still wont work.
  3. Replies
    7
    Views
    2,286

    Why my code will stop running? Thanks!

    When I start to run my code, it will stop anyway, why? Thanks for any help!



    #include <stdio.h>
    #include <string.h>
    #include <stdlib.h>

    typedef struct _list_item {
    int value;
  4. I doubt you solved the problem correctly. Assume...

    I doubt you solved the problem correctly. Assume BLOCK_SIZE = 3, the average should be 3/1 = 3. Why adding the value of the bytes and dividing them by 3. It should be adding the number of the bytes...
  5. I think you are right. here is a piece of my code...

    I think you are right. here is a piece of my code for this implementation. Any comment?


    unsigned char average(const char *filename){
    unsigned int BLOCK_SIZE=512;
    unsigned int nlen=0,...
  6. Sorry, that's all what I have. I was asked to...

    Sorry, that's all what I have. I was asked to implement the function which calculates an average of all bytes in a given file shown in the first post. I dont know what is "average" meaning for either.
  7. How to calculate an average of all bytes in a given file?

    I could get the size of the file in bytes using the function ftell(). I dont know what is an average of all bytes in the file. Thanks for any help! Here is a piece of code:


    unsigned char...
  8. Thanks sean and tabstop! It does make more...

    Thanks sean and tabstop!

    It does make more sense for me now.




    sptr get_s_ptr(int *a_ptr)
    {
    sptr ptr;
  9. Thanks guys! Here is my new trial: ...

    Thanks guys!

    Here is my new trial:




    typedef struct s* sptr;

    struct s{
  10. Yes, you pointed out what I am thinking now. One...

    Yes, you pointed out what I am thinking now. One thing is that how I could "move the whole struct to that location of member a within a struct" passed by the pointer. Is it possible to do that?...
  11. Thank you for reminding me of this. I tried to...

    Thank you for reminding me of this.

    I tried to solve this question, however I dont fully understand why the parameter of function is a pointer to member of the struct and return a pointer to the...
  12. what does this question mean? and solution please!

    Given a pointer to member a within a struct, write a routine that returns a pointer to the struct.


    struct s
    {
    ...
    int a;

    };
Results 1 to 12 of 12