Search:

Type: Posts; User: valenok

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    7
    Views
    5,916

    first of all, 'v' may not be a pointer.

    first of all, 'v' may not be a pointer.
  2. Replies
    7
    Views
    5,916

    you have to understand how the function call...

    you have to understand how the function call works,
    the stack memory layout before and after the call.
    If you do not get it, there is no chance you'll understand va_start() macro.
    some assembler...
  3. Replies
    7
    Views
    5,916

    the _INTSIZEOF(n) macro, I beleive, calculates...

    the _INTSIZEOF(n) macro, I beleive, calculates the size of last named
    argument, 'rounded' to sizeof(int), because v, push-ed on stack before
    call to foo(), is 'rounded' to size. For example, on...
  4. Replies
    7
    Views
    5,916

    to make the picture more clear: stack memory...

    to make the picture more clear:


    stack memory inside foo():
    200
    100 <-- va_start() sets 'ap' here
    3 <-- this is &v. we need to increase to size of v to shift to the first unnamed arg
    2
    1...
  5. Replies
    7
    Views
    5,916

    v is the the argument before ... va_start...

    v is the the argument before ...
    va_start actually sets the pointer 'ap' to point at the stack memory exactly
    below 'v':


    void foo(int a, int b, int c, ...);
    ...
    foo(1,2,3,100,200)

    stack:
  6. Replies
    3
    Views
    1,935

    lpszThisIsMyFormatString. i like that. vice,...

    lpszThisIsMyFormatString. i like that.

    vice, you need to read a book.
    "The C programming Language" by Kernighan & Ritchie,
    chapter 7.3, "Variable-length Argument Lists"
  7. Replies
    8
    Views
    4,437

    does that apply for main() function or for any...

    does that apply for main() function or for any function ?
  8. Replies
    8
    Views
    4,437

    please, tell me the section where they are...

    please, tell me the section where they are described
  9. Replies
    8
    Views
    4,437

    by the way, FAQ mentions that in C99 return 0 is...

    by the way, FAQ mentions that in C99 return 0 is implied if no return is
    present and main() declared as int main().
    in what section is it, by the way ?
    are there rules in C99 about implicit return...
  10. Replies
    14
    Views
    6,929

    on unix, bidirectional streams could be created ...

    on unix, bidirectional streams could be created with
    socketpair() and fdopen().
  11. Replies
    14
    Views
    6,929

    standard pipes are one-way. you cannot read and...

    standard pipes are one-way.
    you cannot read and write to the pipe at the same time.
    If you have opened the pipe as "r", you cannot write to it.
  12. Thread: Link List

    by valenok
    Replies
    8
    Views
    1,313

    actually, that tutorial is not fully correct. For...

    actually, that tutorial is not fully correct. For example, this


    struct node {
    int x;
    node *next;
    };
  13. Replies
    5
    Views
    18,907

    use 'int' for boolean type. what kind of boolean...

    use 'int' for boolean type.
    what kind of boolean functions are you talking about?
  14. Replies
    6
    Views
    19,116

    I can see two ways: 1. declare utf-8 string as...

    I can see two ways:
    1. declare utf-8 string as a byte array:

    unsigned char utf8[] = { 'a', 'b', 0 };
    2. declare string as wide char string, then convert to multibyte.
  15. Replies
    4
    Views
    1,227

    in some situations, you can scan using sscanf()....

    in some situations, you can scan using sscanf().
    The format string must be carefully prepared though.
    For example, this one may work for you:


    const char *str = "Value = California(100)";...
  16. Thread: Logic problem

    by valenok
    Replies
    6
    Views
    1,784

    Yeah. Basically, what you do, is assigning to...

    Yeah. Basically, what you do, is assigning to every variable a unique
    index number.
    Then you represent a user filter as an array of indexes.
    Then, for each row, you prepare a values array....
  17. Thread: Logic problem

    by valenok
    Replies
    6
    Views
    1,784

    I would solve this problem this way: User filter...

    I would solve this problem this way:
    User filter I would represent as an array of variables to see:
    enum {VAR_NONE, VAR_A, VAR_B, VAR_C};

    So, the "B B" filter would look like:
    int filter[] =...
  18. Replies
    9
    Views
    8,280

    by reading standards, and by actually building...

    by reading standards, and by actually building programs on different platforms.
    you may go to http://www.freebsd.org/cgi/man.cgi
    there are man pages for many OSes. in your case, check every...
  19. Replies
    9
    Views
    8,280

    I suggest not using linuxisms. MSG_NOSIGNAL is...

    I suggest not using linuxisms. MSG_NOSIGNAL is one of them.
    The more portable code is, the better.
  20. Thread: long problem

    by valenok
    Replies
    28
    Views
    4,602

    note that laserve himself invented array of...

    note that laserve himself invented array of pointers to long.
    it was array of long-s.
  21. Thread: stack overflow

    by valenok
    Replies
    7
    Views
    1,624

    For every function call stack frame is allocated....

    For every function call stack frame is allocated.
    Shortly, the stack frame consists of return address, stack pointer and local variables.
    If local variables take a lot of space (for example, huge...
  22. Thread: stack overflow

    by valenok
    Replies
    7
    Views
    1,624

    do not recurse that much

    do not recurse that much
  23. Replies
    5
    Views
    1,253

    there are macros in , like isdigit() etc.

    there are macros in <ctype.h>, like isdigit() etc.
  24. Thread: Strings

    by valenok
    Replies
    6
    Views
    1,810

    Yeah, the algorithm may be as this: 1. extract...

    Yeah, the algorithm may be as this:

    1. extract substring.
    2. traverse the storage, looking for duplicate (storage explained below)
    2. 'remember' substring in some storage (put it in the array,...
  25. Thread: long problem

    by valenok
    Replies
    28
    Views
    4,602

    Laserve, how comes that memset leads() to an...

    Laserve, how comes that memset leads() to an undefined behaviour?
    Make it clear please.
Results 1 to 25 of 49
Page 1 of 2 1 2