Search:

Type: Posts; User: beta3designs

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    34
    Views
    29,471

    Hahah ok that's what I thought :) Thanks then!...

    Hahah ok that's what I thought :)
    Thanks then! everything is working as expected thank you very much for the help!
  2. Replies
    34
    Views
    29,471

    Ok got the delete_column function coded now but I...

    Ok got the delete_column function coded now but I just have one doubt, here it is:


    /* delete_column: delete column n from table t */
    void delete_column(table *t, int n){
    int i, j;
    ...
  3. Replies
    34
    Views
    29,471

    Okeeey then now I understand it thanks a lot! I...

    Okeeey then now I understand it thanks a lot! I will try to get the delete_column to work now and I will come soon if I have problems, but I think the idea is pretty similar.. Thanks again!
  4. Replies
    34
    Views
    29,471

    Ok I understand that isn't actually wrong and now...

    Ok I understand that isn't actually wrong and now I think I understand the idea but when you said "data" did you mean all the table entries without the deleted row?
    Well I coded this:


    void...
  5. Replies
    34
    Views
    29,471

    Ok, but I was just trying to follow quzah's...

    Ok, but I was just trying to follow quzah's example:

    I know I have two pointers pointing at the same place but as I was following quzah's example I thought I needed to free the old row pointers...
  6. Replies
    34
    Views
    29,471

    Mmmmm nice...Why disaster may I ask? then I don't...

    Mmmmm nice...Why disaster may I ask? then I don't know what else to do thanks for the help!
  7. Replies
    34
    Views
    29,471

    Ok so I think I got now in my head what you are...

    Ok so I think I got now in my head what you are saying, I should free data in my code not t->cell, I use data to modify the table then free data right? Well I will try to code it that way, seems...
  8. Replies
    34
    Views
    29,471

    Yeah I know that but do you mean doing t->cell =...

    Yeah I know that but do you mean doing t->cell = data just before freeing t->cell or how can I delete the "old" t->cell? I can't still get how can I redefine let's say "A" and then delete old "A"? I...
  9. Replies
    34
    Views
    29,471

    Yeah I that's what I meant a few posts ago that I...

    Yeah I that's what I meant a few posts ago that I don't want to create a new table I need to modify this one, thus freeing the table seemed to me a bit weird

    How should I go about that then? I...
  10. Replies
    34
    Views
    29,471

    Yeah thanks I noticed, I'm just getting so...

    Yeah thanks I noticed, I'm just getting so confused on getting this to worked so I'm messing things lol
    What I've got so far is:


    void delete_row(table *t, int n){
    int i;
    --(t->rows);...
  11. Replies
    13
    Views
    4,223

    @grumpy I think those digits followed by the...

    @grumpy I think those digits followed by the semi-colon are for us to find the lines aren't they?
    Anyway he is missing some brackets after the if statement it should be:

    if (isdigit(p[k]))
    and...
  12. Replies
    34
    Views
    29,471

    Sorry but I was a bit busy this week so I...

    Sorry but I was a bit busy this week so I couldn't get to code this but here I am again, this is what I wrote with the algorithm quzah told me again:


    /* delete_row: delete row n from table t */...
  13. Replies
    34
    Views
    29,471

    But I need to modify the table t, the function...

    But I need to modify the table t, the function doesn't return anything it's a void and if I create new pointers I shall return them so I can work with them later shouldnt I? the function I'm coding...
  14. Replies
    34
    Views
    29,471

    Ok, the problem with your solution quzah is that...

    Ok, the problem with your solution quzah is that I should delete the olddata which I don't want to do I want to modify the original table (or data)... I coded this and it seems to work, it is what...
  15. Replies
    34
    Views
    29,471

    Ok thanks very explanatory ^^ I'll try to code...

    Ok thanks very explanatory ^^
    I'll try to code it and see if I get it right and I'll come back with the result :)
    Thanks again ^^
  16. Replies
    34
    Views
    29,471

    Sorry I got a bit lost then you mean I should...

    Sorry I got a bit lost then you mean I should free the row I want to delete, reasign pointers and then reallocate the memory?
    Ok ;D
    Thanks in advance and sorry to ask the "same" question again but...
  17. Replies
    34
    Views
    29,471

    Oh nice, so Instead of reallocating the memory I...

    Oh nice, so Instead of reallocating the memory I need to free it? Or is it the same? I mean let's say I reassign my row pointers which is moreless what I had thought of when I said shifting the...
  18. Replies
    34
    Views
    29,471

    Delete an element in a dynamic array?

    Ok as part of my project described here I was trying to delete a complete row and column of a 3d dynamic array some kind of 2d matrix of strings...
    Well I'll try to ask the simple question for 1d...
  19. Aaah yeah I understand what you mean :P Good, my...

    Aaah yeah I understand what you mean :P
    Good, my program now works as expected so unless someone wants to say something, topic solved.
  20. Ok thank you very much, updated code is now: ...

    Ok thank you very much, updated code is now:


    void add_row(table *t){
    int i;

    // Increase rows count
    ++(t->rows);

    t->cell = (char ***) realloc(t->cell, t->rows *...
  21. Ok having problems now adding rows instead of...

    Ok having problems now adding rows instead of column... seems I can't learn from my mistakes... u.u
    Now I'm trying to add a new row but I'm getting the same kind of error, here is what I have so...
  22. Yeah sorry I just changed that before you posted!...

    Yeah sorry I just changed that before you posted! lol
    And now it works as expected sooo problem solved and thank you very much!! I will have to change the gets and the fflush thing now...
    P.S....
  23. Ok my new code is this: void...

    Ok my new code is this:


    void add_column(table *t){
    int i;

    // Increase columns count
    ++(t->cols);

    for(i = 0; i < t->rows; ++i){
  24. Thanks for the tip on fflush(stdin) didn't know...

    Thanks for the tip on fflush(stdin) didn't know about that...
    The project I'm writing is some kind of database and since it's very simple it doesn't ask the user which kind of input he wants to...
  25. Sorry it was meant to be how it is now: t->rows...

    Sorry it was meant to be how it is now:
    t->rows * sizeof(char *) and not
    t->cols * sizeof(char *)... I don't know why I changed that neither lol...

    But that's what this does doesn't it?:
    ...
Results 1 to 25 of 48
Page 1 of 2 1 2