Search:

Type: Posts; User: Fiskker

Page 1 of 4 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    10
    Views
    3,955

    I ended up using a loop that repeats rg(A)-1...

    I ended up using a loop that repeats rg(A)-1 times, starting from the last node with a temporary variable, linking it to the previous one and updating the temporary variable.
    Just in case anyone...
  2. Replies
    10
    Views
    3,955

    Thanks. By the way, to do the same thing but...

    Thanks.

    By the way, to do the same thing but backwards (as in going from the last node to the first node in both 'row only paths'), do you agree that I would need 3 pointers to keep track of...
  3. Replies
    10
    Views
    3,955

    Yes, sorry. Okay, yes, I was thinking that the...

    Yes, sorry.

    Okay, yes, I was thinking that the container should have pointers pointing to each entry of both diagonals. Is this what you say in your second paragraph?

    Just to be sure, the...
  4. Replies
    10
    Views
    3,955

    As for the why, it is an exercise that is given...

    As for the why, it is an exercise that is given in this way and has to be solved so that you modify the matrix in the manner that I presented in my first post (see image).

    I'm not sure what you...
  5. Replies
    10
    Views
    3,955

    What I mean by it is that when you edit the...

    What I mean by it is that when you edit the matrix, you go to the N node in the first row, then change it and make it point to the N-1 node in the second row, then go to the N-1 node in the second...
  6. Replies
    10
    Views
    3,955

    Sandclock Linked Lists

    Basically the problem is to go through a matrix (a vector of linked lists) in a 'sand-clock' fashion (as in right; diag left-down; right; diag right-up).

    I made the program, but after testing it,...
  7. Replies
    9
    Views
    6,580

    You are using it wrongly, please see: do...while...

    You are using it wrongly, please see:
    do...while loop in C

    Also, a break statement must be inside the loop, yours is clearly after the loop is executed.
  8. Replies
    13
    Views
    14,152

    Have you read this...

    Have you read this yet?
  9. Replies
    5
    Views
    6,228

    I debug with gdb by passing the -g flag when...

    I debug with gdb by passing the -g flag when compiling.
    GDB: The GNU Project Debugger
    Debugging with GDB: Top

    When running the program with the debugger, if you have a SIGSEGV you'll encounter...
  10. Replies
    5
    Views
    6,228

    As far as I can see I find it weird that you call...

    As far as I can see I find it weird that you call strtok() and then pass token as a parameter, how do you know token is not NULL?

    As a matter of fact it is:

    #1 0x0000000000400a98 in pushWord...
  11. Replies
    4
    Views
    1,961

    customerType is an integer and "Domestic" is a...

    customerType is an integer and "Domestic" is a string, why are you comparing them?

    printf("Enter type of customer (Domestic or Commercial):\n");
    This could be of the type 'D' for Domestic and 'C'...
  12. Right. But how would you "put numbers in a...

    Right. But how would you "put numbers in a string"?
    Do remember how the char type is defined though.


    As long as the user input is a stored in a string then the answer is yes.
    If you choose...
  13. Replies
    4
    Views
    1,961

    Your loop condition is: while (menuChoice != 3)...

    Your loop condition is:
    while (menuChoice != 3)

    This means that if I enter anything different than the number 3 this condition is true, thus the loop will continue by showing the menu.

    As for...
  14. Replies
    24
    Views
    13,649

    Hey, You could use fgets(), you are as a...

    Hey,

    You could use fgets(), you are as a matter of fact checking for the new line character as far as I can see (did not read it toroughly).

    If you want to stick to fgetc() and read character...
  15. Replies
    26
    Views
    3,376

    If I input 333x3fd Is tokenBeforeX = "333" &...

    If I input 333x3fd

    Is tokenBeforeX = "333" & tokenAfterX = "3fd"?
  16. Replies
    17
    Views
    7,143

    I think you are doing just fine, in the above...

    I think you are doing just fine, in the above example you are just mistaking the loop condition:

    for (col = 1; col = row*2-1; col++)
    The '=' is the assignment opeartion, that means that your...
  17. Replies
    17
    Views
    7,143

    I understand, but if you don't provide...

    I understand, but if you don't provide information about what you are doing and what the problem is, meaning what exactly is happening with your current code, then it becomes hard to see what the...
  18. Replies
    17
    Views
    7,143

    But I want to see how you code it, what would you...

    But I want to see how you code it, what would you do?
    What needs to be changed in the for loop that loops the columns, what is the new condition?



    Okay so you are describing it, how do we code...
  19. Replies
    17
    Views
    7,143

    Oh, okay. Well, you were fine by looping each...

    Oh, okay.

    Well, you were fine by looping each row, and then every column, and printing an asterisk until the row was matched, that is:

    1 asterisk in first row.
    2 asterisks in second row.
    .
    n...
  20. Replies
    17
    Views
    7,143

    I guess you can always say that the point of the...

    I guess you can always say that the point of the pyramid is always in the middle, and the middle is the base / 2, right?
    I guess that gives you a starting ammount of spaces, then it decreases...
  21. Replies
    9
    Views
    2,646

    It is more likely you will be helped if you...

    It is more likely you will be helped if you provide code and show what you tried, and in what areas of the code you don't know what to do, or don't understand how to move on, else it becomes rather...
  22. The title specifies it. The code too.

    The title specifies it. The code too.
  23. Replies
    9
    Views
    2,646

    What did you try? What is it that you don't...

    What did you try? What is it that you don't understand?



    What's the content of the text file?
    Is it a simple integer? If it is say a string (a lot of chars), then there is no way it is being...
  24. You are creating a variable then copying data and...

    You are creating a variable then copying data and then using yet another variable, you could just use the parameter as was suggested in the comment above.

    Also I would make sure data is not NULL...
  25. Replies
    25
    Views
    17,545

    Your indentation and bracket use are way off. It...

    Your indentation and bracket use are way off. It is hard to find a problem when reading the code becomes difficult.
    Your problem lies in line 37.

    Here's the code properly indented:


    #include...
Results 1 to 25 of 90
Page 1 of 4 1 2 3 4