Search:

Type: Posts; User: Maz

Page 1 of 8 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    11
    Views
    1,058

    Did you check that out?

    Did you check that out?
  2. Replies
    11
    Views
    1,058

    Well, everyone makes a mistakes with list...

    Well, everyone makes a mistakes with list implementations... It's funny how something so simple tends to go wrong at first attempt - no matter how many lists have you written before =)

    Anyways,...
  3. Replies
    12
    Views
    863

    And using for instead while would combine 3 lines...

    And using for instead while would combine 3 lines in a natural way.
  4. epb: Ethernet package generator - 64 bit testing.

    Hi dee Ho peeps!

    I wrote a tool for sending custom ethernet packages for Linux. I needed this for some very specific iptables tests, VLAN tests as well as for arp generation. When I wrote this I...
  5. Replies
    16
    Views
    13,101

    I am not too good with standards, but I will...

    I am not too good with standards, but I will explain you what I've seen in real implementations. I bet others will give specific details about what is required and defined, and what is just assumed...
  6. Replies
    16
    Views
    13,101

    For my eyes loop is not pretty either. What about...

    For my eyes loop is not pretty either. What about


    char Posn[4] = {0xff,0xff,0xcf,0x13};
    char Posn_be[4] = {0x13,0xcf,0xff,0xff};
    short one=1;
    int n;
    char *tmp=(char *)&one;

    if(*tmp)
  7. Replies
    2
    Views
    1,946

    It would be nice to know a bit more of this....

    It would be nice to know a bit more of this. What's the purpose here? TCP itself is a protocol taking care of retransmissions if needed.
  8. Thread: A good C compiler

    by Maz
    Replies
    15
    Views
    3,742

    I guess choosing IDE really is a matter of taste....

    I guess choosing IDE really is a matter of taste. Most of us have propably tried a bunch of them, and then stuck with one that suits them best. Same goes with the environment in general (like...
  9. Replies
    29
    Views
    2,870

    /* You're evaluating s[i+1] here... When will...

    /* You're evaluating s[i+1] here... When will s[i+1] be set? */
    if (s[i] == '/' && s[i+1] == '*') /*entering the comment*/
  10. Replies
    27
    Views
    6,111

    I just had to like this a bit more =) command...

    I just had to like this a bit more =) command line terminal with minimal display... Resisting everything new... Recognized some parts suiting me. Utopia is still the best strategy computer game. Unix...
  11. Thread: Types in C

    by Maz
    Replies
    14
    Views
    1,052

    well. I try not to argue. At first I just...

    well. I try not to argue. At first I just impressed my dislike using word "type" with C strings. Reason was that for me word type suggested that "thing" which we are talking about has known size thus...
  12. Replies
    29
    Views
    2,870

    Correct. assignment / comparison wont work for...

    Correct. assignment / comparison wont work for arrays either.

    Mmm.. What do you mean by saying that sizeof() works for C strings?



    char str[20]="foobar";


    there str is an array, but not...
  13. Replies
    29
    Views
    2,870

    Actually, I would not say the C-strings are a...

    Actually, I would not say the C-strings are a composite type. I'd say they're not data type, they're data object.
    For (compatible) types, assignment would work. For types, comparison would work....
  14. Replies
    29
    Views
    2,870

    furthermore, explaining C strings as type gives...

    furthermore, explaining C strings as type gives false idea of what they are. It encourages you to use assignment with strings.it encourages using sizeof() badly. It is plain ugly way to explain...
  15. Replies
    29
    Views
    2,870

    Actually I never said I am writing C standard...

    Actually I never said I am writing C standard here. Nor did I say one must not simplify things. However, according to my experience, in order to be able to use C effectively you need to understand...
  16. Replies
    9
    Views
    1,309

    well, I give up. It's of course your business why...

    well, I give up. It's of course your business why you want to manipulate text ptr. you could propably avoid temp ptr, but we cant help unless we know what you plan. Just do not use allocated memory...
  17. Replies
    9
    Views
    1,309

    I see what you do, but why? Looks like you're...

    I see what you do, but why? Looks like you're getting rid of the first letter of name?

    memmove is heavyish operation. So I would like to ask why you're doing it? Maybe, just maybe you could go on...
  18. Replies
    3
    Views
    3,969

    I usually use shm_open() ftruncate() mmap()...

    I usually use

    shm_open()
    ftruncate()
    mmap()

    sequence. You propably will also need sem_open, sem_wait and sem_post to synchronize the access to shm. You propably do not want clients being...
  19. Replies
    29
    Views
    2,870

    This is true. And by no means do I say that...

    This is true. And by no means do I say that there's something wrong with it. However I personally hate this approach.
    For me there is no such fundamental type as string in C. There is just type...
  20. Thread: Wats wrong!!

    by Maz
    Replies
    6
    Views
    1,187

    \b does not really remove anything from your...

    \b does not really remove anything from your string. It is a terminal escape code, which alters the way a string is shown in terminal. It does not however remove any characters from your string. If...
  21. C is not a scripting language. Thus the function...

    C is not a scripting language. Thus the function names are not really usable at runtime, when your variables get evaluated.

    You could accomplish this using function pointers - Eg,



    void ...
  22. Since it looks like the OP has not been...

    Since it looks like the OP has not been interested in commenting this topic lately, I would like to ask which part of my source was so horribly broken? I simply do not spot that myself. So please...
  23. In this example? Nothing. Absolutely nothing. ...

    In this example? Nothing. Absolutely nothing.

    Depending on what such a list does contain - possibly a lot. Maybe it would be a message queue? Networking protocol stack? Maybe a slab memory pool,...
  24. Allright. Yes. Naturally linked list itself gets...

    Allright. Yes. Naturally linked list itself gets scattered. But we do not get yet another block of memory for allocated character array.

    eg, instead of

    [list header] -> [ char array]
    |...
  25. The one character array is accesspoint to data (a...

    The one character array is accesspoint to data (a placeholder), appended at the end of the struct. As you can see from init function, there will be space allocated at the end of the struct. That way...
Results 1 to 25 of 196
Page 1 of 8 1 2 3 4