Search:

Type: Posts; User: atlantis43

Page 1 of 2 1 2

Search: Search took 0.00 seconds.

  1. Replies
    0
    Views
    523

    reverse recurrent fn() output?

    In working on a problem to solve Huffman coding, I've developed the following simple code to get a table for values in the binary tree, which prints the path from root to leaf. Forgive what I'm sure...
  2. Replies
    6
    Views
    1,713

    gdb breakpoints

    finally got the right combination of switches in Makefile to allow gdb to function:

    #############################################################################
    # Makefile for huffman...
  3. Replies
    6
    Views
    1,713

    I'll take a look & see if anything works. So far...

    I'll take a look & see if anything works. So far I've tried redoing Makefile in all sorts of combos, and remade file, but still not the right combo. Maybe the links will help.
  4. Replies
    6
    Views
    1,713

    No luck. With your first suggestion, I get...

    No luck. With your first suggestion, I get terminal output of:

    jharvard@appliance (~/Dropbox/huffman): makegcc sample.o libhuffman.a liboptlist.a -L. -lhuffman -loptlist -03 -o sample
    gcc: error:...
  5. Replies
    6
    Views
    1,713

    gdb breakpoints

    In order to understand a program for data compression, I'm trying to step through a program using GDB, and am having a problem setting a breakpoint.The code is all in a single directory, and the...
  6. Replies
    8
    Views
    798

    Thanks to all for clear reply.

    Thanks to all for clear reply.
  7. Replies
    8
    Views
    798

    why use for() with no args?

    As a novice, came across some code which started out as follows, and am wondering why such a "for loop" is used at all? I don't understand the meaning of including what I would interpret logically as...
  8. Replies
    6
    Views
    1,041

    Thanks for the detailed review of all items in...

    Thanks for the detailed review of all items in this thread. I thought that I did 'wrap' all code, save for the short descriptive text/explanation of the problem to solve:

    Seemed easiest to express...
  9. Replies
    6
    Views
    1,041

    thanks for quick reply. Just a further question...

    thanks for quick reply. Just a further question as to freeing such an allocation.
    Would this work ?:

    while(int i < 26)
    free(arr[i]);
  10. Replies
    6
    Views
    1,041

    memory allocation for string arrays

    wondering if anyone can advise on the above subject.
    I've tried starting with the following, but this only works for char array. My array should consist of r strings of strlen <= 25. These strings...
  11. Processor handling of bitwise operators

    Can someone explain in what order a CPU would process the following arithmetic problem: 5 - (-9) = 14?
    Would the CPU recognize that the 'minus a minus' combination simply represents 5 + 9, and...
  12. Glad to see that I at least understood the...

    Glad to see that I at least understood the redundancy of the example cited. I'll still have to give some thought as to the examples that you and WoodSTockk have cited, in order to understand the...
  13. Confusion: C programming: textbook unclarity

    The following code appears in a text regarding bitwise shift operations, with the following descriptive text:



    #include <stdio.h>
    #define BYTE_MASK 0xff

    int main(void)
    {
    unsigned long...
  14. Replies
    5
    Views
    1,378

    Nominal Animal; thanks for your clear & detailed...

    Nominal Animal;
    thanks for your clear & detailed explanation. This, together with the above-mentioned C Programming link should help me undo my ignorance.
  15. Replies
    5
    Views
    1,378

    This looks like a great link for my purposes (and...

    This looks like a great link for my purposes (and novice level).
    Thanks again.
  16. Replies
    5
    Views
    1,378

    Guess I have to scrutinize those links (which...

    Guess I have to scrutinize those links (which I've previously seen), but what type of empty variable is needed to hold the bits?
    Wouldn't unsigned int be 4 bytes for each of 256 elements: or is...
  17. Replies
    5
    Views
    1,378

    help for novice re: Huffman tree

    I'm trying to code a Huffman tree header, with the ADT defined from an old on-line course in C programming. I'm stumped by the following instructions:

    I've already made a character-frequency...
  18. Replies
    8
    Views
    835

    Now that I understand, I see how appropriate your...

    Now that I understand, I see how appropriate your post was. I guess I'm just a bit slow.
  19. Replies
    8
    Views
    835

    Oh, enlightenment! getchar() is consuming all...

    Oh, enlightenment!
    getchar() is consuming all chars remaining in buffer, but continue; only applies for chars other than '\n'. Thanks to all for your aid.
  20. Replies
    8
    Views
    835

    Thanks for including the word "consumed", which...

    Thanks for including the word "consumed", which helps make some sense of it: but the question remains as to why '\n' is "consumed" even though, in such case, the 'while' condition is false. Is this...
  21. Replies
    8
    Views
    835

    "clearing buffer" confusion

    Hope that someone can clarify my confusion with the following common "instructional" code for clearing buffer:
    while ( getchar() != '\n') continue;
    As per manual,
    I understand that such code...
  22. Replies
    3
    Views
    907

    Yup, that corrects the problem. Still don't...

    Yup, that corrects the problem. Still don't understand why it gave the consistent additional garbage value = 3 in the output, even after attempts at re-compiling with variations. Any explanation?
  23. Replies
    3
    Views
    907

    function with unexpected value

    In an online exercise, I'm getting an unexpected additional value in my result, which I can't seem to explain.

    #include <stdio.h>
    #include <stdlib.h>

    struct node
    {
    int i;
    struct...
  24. Replies
    4
    Views
    2,351

    Ok, so I see buttons, but the only usable ones...

    Ok, so I see buttons, but the only usable ones are "debug" and "add watch". All others are greyed out. If I push "Debug", it just runs the code to completion, without giving a chance to step through...
  25. Replies
    4
    Views
    2,351

    I don't know how to enter gdb commands: eg, 'r',...

    I don't know how to enter gdb commands: eg, 'r', 'b', 'n', 's',etc, or where to enter such commands on the screen window (or, for that matter, how and where to enter parameters, when needed. I'm use...
Results 1 to 25 of 29
Page 1 of 2 1 2