Search:

Type: Posts; User: P.Phant

Search: Search took 0.01 seconds.

  1. Replies
    11
    Views
    2,288

    I think I skipped quzah's post, at least I didn't...

    I think I skipped quzah's post, at least I didn't follow the link. :o

    Any precision would be appreciated :D, I read the K&R chapter about this a bit quickly I must confess... But an idea of how...
  2. Replies
    11
    Views
    2,288

    Well correct me if I'm wrong, or if didn't...

    Well correct me if I'm wrong, or if didn't understand what minignaz means to do, but what I understood is that he wants to "resize" an array. In this case using malloc/calloc then free and memcpy...
  3. Replies
    11
    Views
    2,288

    And you could use realloc to give it a chance to...

    And you could use realloc to give it a chance to run faster.
  4. Replies
    11
    Views
    8,921

    if (s1[j] == '\0') s1[k++] = s1[i]; ...

    if (s1[j] == '\0')
    s1[k++] = s1[i];

    I think the problem is there no? (didn't try to run it)
    it should be:


    if (s2[j] == '\0')
    s1[k++] = s1[i];
  5. Replies
    3
    Views
    2,481

    Thanks Salem. I realise that, that was just an...

    Thanks Salem.

    I realise that, that was just an exemple, albeit not a very good one :).

    I feel a bit stupid to insist about this thing, since I have actually never encountered a problem. What...
  6. Replies
    3
    Views
    2,481

    Thanks guys. Salem, I might be wrong, but I...

    Thanks guys.
    Salem, I might be wrong, but I think what you are saying is true only for complement to 2 representation.

    "implementation defined" OK :) . Not very portable though.

    Can I expect...
  7. Replies
    3
    Views
    2,481

    unsigned and signed char

    It feels like I'm drowning in a glass of water...

    Am I missing something or according to the standard does this have undefined behaviour when working with non ASCII chars?


    //...
    int i =...
  8. Replies
    19
    Views
    43,412

    Thanks quzah. :) Why didn't I think of...

    Thanks quzah.



    :)

    Why didn't I think of outputting the pointer? oh well...
  9. Replies
    19
    Views
    43,412

    Sorry I'm kind of highjacking the thread but I've...

    Sorry I'm kind of highjacking the thread but I've been wondering about this for some time:



    say I write
    foo1("Hello World");
    and somewhere else in the same module:
    foo2("Hello World");
    ...
  10. Replies
    18
    Views
    2,931

    C99 would accept that: int...

    C99 would accept that:


    int html_findstarttag(char *src, char tag[]) {
    char search[strlen(tag) + 3 ];

    html_createstarttag(search, tag);

    return whereis_string(src,...
  11. Thread: va_copy

    by P.Phant
    Replies
    4
    Views
    3,474

    Thanks again, there seems to be a problem with...

    Thanks again, there seems to be a problem with flashdadee for now and I've been unable to find your code. But though I do not really know much Assembly (yet) I I'll try to look into it.
  12. Thread: va_copy

    by P.Phant
    Replies
    4
    Views
    3,474

    Thanks ygfperson. I *think* that for most...

    Thanks ygfperson.
    I *think* that for most implementations arguments is simply a pointer to the stack. In this case no problem to assign the address to an other va_list, or to pass the pointer by...
  13. Thread: C99 compiler

    by P.Phant
    Replies
    3
    Views
    1,685

    Under Windows Mingw is a good bet I think (gcc...

    Under Windows Mingw is a good bet I think (gcc port), though the broken features also aplies there. As a bonus you can have an IDE :
    Dev C++
    That is what I use and I'm happy with it :). But then I...
  14. Thread: va_copy

    by P.Phant
    Replies
    4
    Views
    3,474

    va_copy

    Hi, I'd like to know if this will do what I expect on all platforms (standard C99):




    void foo1(va_list arguments)
    {
    va_list arg_copy;
    va_copy(arg_copy,arguments);
Results 1 to 14 of 14