Search:

Type: Posts; User: hamster_nz

Page 1 of 7 1 2 3 4

Search: Search took 0.01 seconds.

  1. Data models are hard! How about using the more...

    Data models are hard!

    How about using the more abstracted 'regions' structure?

    Countrys could be owners of regions...
  2. Is all your code pushed up to Github? I'm at a...

    Is all your code pushed up to Github? I'm at a loose end and might have a look...
  3. Replies
    3
    Views
    263

    Have you compiled it with all the compiler...

    Have you compiled it with all the compiler warnings on?

    The '- Wall' option if using GCC
  4. I always thought it was a slightly truncated UDP...

    I always thought it was a slightly truncated UDP packet.
  5. Replies
    19
    Views
    685

    Just in case you are still interested, or...

    Just in case you are still interested, or somebody else stumbles over this thread, here is source code that sends data to the host "hamster-nuc" on port 1234. The comments should be enough to know...
  6. Thread: assign bits

    by hamster_nz
    Replies
    10
    Views
    316

    Usual use binary AND or OR operators. C does...

    Usual use binary AND or OR operators.

    C does have bit fields, but they are not used much.
  7. Thread: assign bits

    by hamster_nz
    Replies
    10
    Views
    316

    What's the question? What do you want to do.

    What's the question? What do you want to do.
  8. Thread: assign bits

    by hamster_nz
    Replies
    10
    Views
    316

    Yes.

    Yes.
  9. I would do it another way... get the input into...

    I would do it another way... get the input into an int variable, and then only malloc and add the node when it is != 0.



    void take(node **list_end)
    {
    while(1) {
    int a;
    ...
  10. Looking good! Do you really want to add the...

    Looking good!

    Do you really want to add the zero to the list?
  11. Ok... let's see. Good points. It compiles...

    Ok... let's see.

    Good points.

    It compiles without errors.

    Bad points - just about everything else.

    So let's start with the printfrom() function.
  12. Oh, and if you call malloc() to allocate...

    Oh, and if you call malloc() to allocate something, you should also be calling free() to release the memory back to the system.
  13. There is a bigger logical problem - what does an...

    There is a bigger logical problem - what does an empty list look like?
  14. The pattern followed seems a little bit off. I...

    The pattern followed seems a little bit off.

    I would expect to only allocate a new node when you have a non-zero number.

    But for deleting, you have three cases.

    1. The item is the head of...
  15. Code with my analysis // Where is...

    Code with my analysis



    // Where is "#include <stdio.h>"???


    int main()
    {
    // Let the compiler work out the size of the storage required
  16. And also, what is the value of 'k' in the topmost...

    And also, what is the value of 'k' in the topmost for loop?
  17. Oh and in the nested for loop the expression for...

    Oh and in the nested for loop the expression for when to keep looping seems wrong.

    It will stop when the element in w is zero.
  18. Sizeof() gives the size of the array, not the...

    Sizeof() gives the size of the array, not the size of the initialized items.

    So you are tooping to 1000.
  19. Simple implementation... (sorry for typos on...

    Simple implementation... (sorry for typos on phone)



    x = 0;
    while ( x < input_len - 8 - prefix_len)
    {
    If prefix seen at position x
    {
    Grab 8 bits starting from x+prefix_len to...
  20. Would it also be correct to say.. . You are...

    Would it also be correct to say.. .

    You are looking for sequences, 'ppppddddddd' , where 'p' is the known prefix (that in this case has a length of four) , and 'd' is 8 data values that needs to...
  21. Replies
    10
    Views
    514

    In this loop: while...

    In this loop:


    while (huffTable[*leftIndex].PA != -1 || huffTable[*leftIndex].weight == 0) {
    (*leftIndex)++;
    }


    There is nothing to ensure that *leftIndex does not exceed the size...
  22. Replies
    10
    Views
    514

    Line 19. You most likely want ...

    Line 19. You most likely want



    (*leftIndex)++;


    Likewise on line 34:
  23. Replies
    10
    Views
    514

    Your code won't compile for me. gcc -o...

    Your code won't compile for me.



    gcc -o main main.c -Wall -pedantic -lm
    main.c: In function ‘find2Lowest’:
    main.c:19:5: warning: value computed is not used [-Wunused-value]
    ...
  24. Replies
    6
    Views
    388

    Just to prove the power of code reviews :D ...

    Just to prove the power of code reviews :D



    stStruct **allocMyArray(size_t dimense)
    {
    stStruct **myArray = malloc(sizeof(myArray[0]) * dimense);
    if (!myArray) {
    return NULL;...
  25. It does: $ ./main enter the size of...

    It does:



    $ ./main
    enter the size of array (row) & (column) : 2 2
    enter the number : 1 2 3 4
    1 2
    3 4
    $
Results 1 to 25 of 174
Page 1 of 7 1 2 3 4