Search:

Type: Posts; User: ddutch

Page 1 of 4 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    3
    Views
    2,922

    Many large programs are programmed in plain C !

    Many large programs are programmed in plain C !
  2. Replies
    3
    Views
    2,383

    Defenitily YES!

    Defenitily YES!
  3. Your: for( int i = 0 ; i == MAXIM ; i++ )...

    Your: for( int i = 0 ; i == MAXIM ; i++ )
    Better could be:
    for( int i = 0 ; i < MAXIM ; i++ )
  4. Replies
    2
    Views
    7,402

    You wrote: "I have 8 bit string and I want...."...

    You wrote: "I have 8 bit string and I want...."
    Just for the record; your "unsigned char buffer[8]" is an array of 8 bytes and it is not 0-terminated so it is not a C-string...
  5. Replies
    6
    Views
    3,501

    oeps, the for statement should count until x

    oeps, the for statement should count until x < 172 since one byte is needed for the 0 character
  6. Replies
    6
    Views
    3,501

    It should work but it looks a bit funny to...

    It should work but it looks a bit funny to initialize x with -1 and increase x as long as it is smaller than 171
    and indeed don't forget the terminating 0

    I think the code looks better if you...
  7. #include int main() { unsigned...

    #include <stdio.h>

    int main()
    {
    unsigned char aByte = 1; // == 00000001
    unsigned char myInput = 126; // just some random value which fits inside a byte (unsigned char)
    unsigned...
  8. Replies
    6
    Views
    7,949

    what about: temp->next = malloc(..); temp =...

    what about:
    temp->next = malloc(..);
    temp = temp->next;
    ----
    ....
    temp->next = NULL;
  9. In C, global variables, like myItem are...

    In C, global variables, like myItem are initialized to 0 or NULL by the compiler !
    Item_Array my_array is not a global variable and thus not initialized, only during run-time you assign values of...
  10. Replies
    4
    Views
    9,031

    Your code above will cause runtime problems...

    Your code above will cause runtime problems (segmentation fault) because the pointers iptr and fptr probably do not point to allocated memory
    so you cant assign a value to be contained by that...
  11. Replies
    1
    Views
    6,809

    I once wrote a web-server (which is a long story)...

    I once wrote a web-server (which is a long story) and used epoll. One of the functions I used was epoll_ctl(). Through this function one can determine for example that the client is no longer...
  12. In your very first example you try to copy a...

    In your very first example you try to copy a string into an integer ....
    In your other code snippets, you let a char- pointer point to an already existing array (of chars), that works.
    But in your...
  13. Replies
    6
    Views
    7,241

    Don't want to patronize but your functions must...

    Don't want to patronize but your functions must have and return a certain data-type. Or void if they return nothing.
    Like

    int main()
    {
    ---------
    return(some_integer_value);
    }
  14. Thread: bit field on c

    by ddutch
    Replies
    2
    Views
    6,028

    FYI, the sizeof() a struct foo shows you the...

    FYI, the sizeof() a struct foo shows you the size of an unsigned int ( which on my system is 4 (bytes)).
  15. Through the Tiobe Index you might get an idea of...

    Through the Tiobe Index you might get an idea of their definition of what is a programming language and also of what are the most used/popular programming languages.
    See:
    Programming Languages...
  16. Thread: input check

    by ddutch
    Replies
    9
    Views
    6,138

    The header-file ctype.h shows a whole lot of...

    The header-file ctype.h shows a whole lot of character handling functions.
    Or have a look here: The GNU C Library
  17. Replies
    3
    Views
    2,922

    Use proper indentation.... Start with including...

    Use proper indentation....
    Start with including the appropriate header-files
  18. you might like the C-library function strstr()

    you might like the C-library function strstr()
  19. Replies
    6
    Views
    3,141

    sorry christop, while I was typing you already...

    sorry christop, while I was typing you already sent an answer
  20. Replies
    6
    Views
    3,141

    You can use a pointer to a function and also pass...

    You can use a pointer to a function and also pass the parameter(s) which go with that function.
    It does not look nice/readable but it can be done.
    For example:



    #include <stdio.h>

    void...
  21. The code above is just a general idea, the rest...

    The code above is just a general idea, the rest you have to work out by yourself
  22. You can put the display of the main menu inside a...

    You can put the display of the main menu inside a while-loop which only stops if the user chooses option 3. Also then dsplyPswd() should return 3 and its value should be assigned to the variable...
  23. First of all, this is not correct. You forgot...

    First of all, this is not correct.
    You forgot the space required for the 0-character at the end of yesno

    It is also a good habit to NOT use global variables when you not realy need to., keep...
  24. Thread: calculate hours

    by ddutch
    Replies
    3
    Views
    2,549

    You can convert date A into a time_t value...

    You can convert date A into a time_t value (seconds passed since 00:00:00 on January 1, 1970) and do the same with date B. Next use difftime()

    In order to convert a certain date into an above...
  25. Thanks for your comments, it can be good for...

    Thanks for your comments, it can be good for portability to be somewhat "pedantic"

    Using the GNU Compiler Collection (GCC): C Dialect Options
Results 1 to 25 of 94
Page 1 of 4 1 2 3 4