Search:

Type: Posts; User: Iiz

Search: Search took 0.01 seconds.

  1. Thread: Pointer troubles

    by Iiz
    Replies
    6
    Views
    344

    Really sorry to bump it, I finally found the...

    Really sorry to bump it, I finally found the problem of the RTE. I did get some extra help but yeah my code for deleting a node was accessing stuff from null pointer. I'll post the correct code in...
  2. Thread: Pointer troubles

    by Iiz
    Replies
    6
    Views
    344

    @flip1969 and @Niccolo Thanks a lot to both of...

    @flip1969 and @Niccolo Thanks a lot to both of you. I didn't know that -> operator had precedence over * till now. There were few logical errors in my code too but I think I cleaned it up. I was...
  3. Thread: Pointer troubles

    by Iiz
    Replies
    6
    Views
    344

    Pointer troubles

    Hello all this is my code:

    #include <stdio.h>
    #include <stdlib.h>
    struct Node
    {
    int data;
    struct Node* prev;
    struct Node* next;
    };
  4. Replies
    9
    Views
    1,218

    Nah, it's fine. You're helping people voluntarily...

    Nah, it's fine. You're helping people voluntarily it's ok to get angry ^^
    Anyway, I am posting a screenshot that my program worked. Idk what are the policies of this site but sharing solved code...
  5. Replies
    9
    Views
    1,218

    oh. Really sorry to be a bother and getting on...

    oh.
    Really sorry to be a bother and getting on your nerves. I'll try to fix the malloc problem soon but for now, the problem didn't really need a dynamic allocation. I'll surely update it and in due...
  6. Replies
    9
    Views
    1,218

    So, I am supposed to think of getting the desired...

    So, I am supposed to think of getting the desired output without storing the input? Or by only partially storing the input?

    EDIT1 - I rethought my approach to this problem as Salem said....
  7. Replies
    9
    Views
    1,218

    I know I am being unreasonable when the...

    I know I am being unreasonable when the constraints are so huge but that's what's given as constraints. Here's a screenshot:
    15194
    Sorry, I forgot to add sample input and output.
    Input:
    4
    65...
  8. Replies
    9
    Views
    1,218

    Most probably memory allocation issue

    I think I've got the logic of the problem correctly(although a bit messy)

    Initally, I had done this with static variable of size 10 but the challenge is to take very large inputs (upto 10^100) so...
  9. Replies
    13
    Views
    1,058

    I think I somehow get it, I'll look over it. For...

    I think I somehow get it, I'll look over it. For now, it's working. I have not freed the memory arr takes but I don't think it'll cause any problem. Thanks, is there any way to mark it solved in here?
  10. Replies
    13
    Views
    1,058

    Now for sure, I can say it's working. Whew, so...

    Now for sure, I can say it's working. Whew, so why was it not working before and skipping the last term? i<c-1 means that second last element right? What was I not taking into account?
  11. Replies
    13
    Views
    1,058

    Do you mean i

    Do you mean i<c-1 ? I don't get this part at all. c<c-1 doesn't help, neither dose changing it to i<c-1. Why isn't it actually printing the last element?
  12. Replies
    13
    Views
    1,058

    Ahhh, it's working now. I ran the loop to c-1 and...

    Ahhh, it's working now. I ran the loop to c-1 and changed the allocation to k+1, I forgot initially k was 0. Not tried to remove the recast thing yet. I can now free the old arr without any problem...
  13. Replies
    13
    Views
    1,058

    Augh, I am so stupid this is my previous code...

    Augh, I am so stupid this is my previous code which had the realloc mistake. Could you kindly check this one instead:


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


    struct poly
    {
    float exp;
    ...
  14. Of course we can compare two similar numbers,...

    Of course we can compare two similar numbers, you're absolutely correct when nums[inner]=nums[outer]=nums[0], basically it's comparing the same number so the if would return a false in this case. Try...
  15. Replies
    13
    Views
    1,058

    Thanks for your input but I don't want to create...

    Thanks for your input but I don't want to create more structures. Basically, I don't need to differentiate the polynomials when I am going to add them. Also when I read the polynomial terms I use a...
  16. Replies
    13
    Views
    1,058

    Memory allocation help

    Hello, I am trying to write a simple program where I want to find sum of polynomials. I've found out the my code is somewhere wrong during the sorting step using valgrind but I don't know why? Could...
  17. C does not have an array bound checking so even...

    C does not have an array bound checking so even if you create an array of size 1, it will show no error in accepting hundreds of characters/data. But you might not be able to access them since...
Results 1 to 17 of 17