Search:

Type: Posts; User: thinhare

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Replies
    3
    Views
    1,304

    Thanks for the answer. I know pass by...

    Thanks for the answer.

    I know pass by reference and pass by value, but haven't paied any attention to return by value and reture by reference before, and apparently they are two apples on the same...
  2. Replies
    3
    Views
    1,304

    overloading operator+ (heap? stack?)

    Hello,

    I am reading some c++ tutorial about operator overloading, and the following code given as an example for operator+ overloading has had me very much confused.


    const MyClass...
  3. Replies
    2
    Views
    6,531

    how gnu make tells if file's been changed?

    I am writing a program to test if the file has been modified recently, and am thinking about how to implement it.

    To know if a file has been changed, there has to be a reference to compared. My...
  4. Replies
    7
    Views
    5,893

    I don't get it. valenok. After all, I know v is...

    I don't get it. valenok.
    After all, I know v is a pointer, and &v is a pointer, too, pointing to somewhere in the stack where v is stored. Thanks!
  5. Replies
    7
    Views
    5,893

    Understanding va_start(ap, v) in STDARG.H

    #define _INTSIZEOF(n) ( (sizeof(n) + sizeof(int) - 1) & ~(sizeof(int) - 1) )
    #define va_start(ap,v) ( ap = (va_list)&v + _INTSIZEOF(v) )What type is of v? Not a pointer, I think, otherwise, there...
  6. Replies
    7
    Views
    1,557

    I don't think so. Because the size of the pointer...

    I don't think so. Because the size of the pointer here will be 4, unchanged. And that we expect, that needs to be plused, is the length of the string the pointer is pointing at, but not pointer...
  7. Replies
    7
    Views
    1,557

    Maybe I didn't make myself clear. You said "if...

    Maybe I didn't make myself clear. You said "if sizeof fmt is 6", OK, there must be a way to count it so we can know about it. And what I doubt is the implementation in the STDARG.H in whihc it count...
  8. Replies
    7
    Views
    1,557

    yes, I agree with you. but the code in STDARG.H...

    yes, I agree with you. but the code in STDARG.H seems to be against what we think.

    void minprintf(char *fmt, ...)
    // Here we can see fmt is a pointer

    va_start(ap, fmt);
    // And the pointer...
  9. Replies
    7
    Views
    1,557

    Understanding va_start(ap, v) in STDARG.H

    #define _INTSIZEOF(n) ( (sizeof(n) + sizeof(int) - 1) & ~(sizeof(int) - 1) )
    #define va_start(ap,v) ( ap = (va_list)&v + _INTSIZEOF(v) )What type is of v? Not a pointer, I think, otherwise, there...
  10. Replies
    6
    Views
    2,057

    you are damn right. ^_^

    you are damn right. ^_^
  11. Replies
    6
    Views
    2,057

    yes, but it doesn't say it will be initialized to...

    yes, but it doesn't say it will be initialized to 0 by default if no explicit initialization.
  12. Replies
    6
    Views
    2,057

    Thank you!!! kermit. I just got it proved. I...

    Thank you!!! kermit. I just got it proved. I referred to K&R "the c programming language" but it doesn't say anything about this.
  13. Replies
    6
    Views
    2,057

    variable can auto initialize itself?

    Below, the code is from the book "Programming Windows" written by Charles Petzold. It sure can be compiled and run correctly. Something weird happened to the variable "fAngle".


    void FillBuffer...
  14. Replies
    7
    Views
    1,363

    I just referred to msdn help and knew that...

    I just referred to msdn help and knew that lstrspy also deals with wide charactor, unicode.
  15. Replies
    7
    Views
    1,363

    lstrcpy is almost the same as strcpy. (Maybe, not...

    lstrcpy is almost the same as strcpy. (Maybe, not very sure.)

    And question here is, malloc(0) also returns a valid pointer but not NULL, so I am worrying when textOutput[0] = '\0', it is exactly...
  16. Replies
    7
    Views
    1,363

    It's hard to explain without the context in the...

    It's hard to explain without the context in the code. I will paste them here.

    Here I need to make sure one thing first. How to initial a variable as follows:


    LPSTR textOutput = NULL;...
  17. Replies
    7
    Views
    1,363

    What if malloc returns a zero-length space?

    no error in compiling time, no error while running, but I just feel insecure. I tested the size of returned space, it was 4. don't know why not 0?????
    what wrong with it?

    char *space = NULL;...
  18. Replies
    25
    Views
    2,048

    Salem, the image in your profile is so much fun....

    Salem, the image in your profile is so much fun. I really like it.

    As for the difference between debug and release build of MSVC, I have to say that it is the same for pointer initialization...
  19. Replies
    25
    Views
    2,048

    Thanks, Narf & Ancient Dragon. Narf, since you...

    Thanks, Narf & Ancient Dragon.

    Narf, since you just commented out _memset_ and didn't do anything about initialization, can I take that for it's not necesary to do so and can just leave it for...
  20. Replies
    25
    Views
    2,048

    To Quzah, But the tabs are all inserted by...

    To Quzah,

    But the tabs are all inserted by editors, like MSVC or UltraEditor, not by myself. It's from so-called auto-indent function. Do you mean that I need replace them all with spaces by hand?
  21. Replies
    25
    Views
    2,048

    To Narf, sorry, I don't get your point. If memset...

    To Narf, sorry, I don't get your point. If memset is not needed, why calloc does the same thing?

    Yes. I got it. I replied too quickly prior to reading through the posts.
  22. Replies
    25
    Views
    2,048

    but what do you mean by _not use tabs_?

    but what do you mean by _not use tabs_?
  23. Replies
    25
    Views
    2,048

    Thank you dwks. I am correcting my code. There is...

    Thank you dwks. I am correcting my code. There is not only one place where recursion is being used. I do need to rethink about it.
  24. Replies
    25
    Views
    2,048

    If the use of recursion is so dangerous, do you...

    If the use of recursion is so dangerous, do you have any idea to make this done without recursion.

    Explanation:
    I want to display a column on the screen, which will be divided into many block...
  25. Replies
    25
    Views
    2,048

    Thank both of you. Salem, your code seems much...

    Thank both of you.

    Salem, your code seems much more reasonable than mine. I just moved a line out of WHILE loop since I don't think redefining a variable time and again and again is a good idea....
Results 1 to 25 of 64
Page 1 of 3 1 2 3