Search:

Type: Posts; User: black_stallion

Search: Search took 0.01 seconds.

  1. Replies
    6
    Views
    1,894

    Yes I realized that..I've already modified my...

    Yes I realized that..I've already modified my code. Thanks!
  2. Replies
    6
    Views
    1,894

    Okay I see..Thanx!:)

    Okay I see..Thanx!:)
  3. Replies
    6
    Views
    1,894

    Might be? Does that mean this copy is sometimes...

    Might be? Does that mean this copy is sometimes deleted and sometimes not(and thereby wasting memory if I make such repeated calls)?
  4. Replies
    6
    Views
    1,894

    Using references and *this?

    Consider the following class.

    class complex
    {
    private:
    int r,i;

    public:
    complex operator + (complex c2)
    {
  5. Thanks a ton! Indeed the debugger set its value...

    Thanks a ton! Indeed the debugger set its value to 0 explicitly.!:D Just about everything other than that variable had been initialized. Amusing how just one glitch can affect a program's output!
  6. Code does not work when 'run' ing it but works fine while debugging?

    I have a code to convert a number to words(e.g. 31415-->Thirty one thousand four hundred fifteen) The code compiles with no errors/warnings and outputs correctly when debugging. But nothing happens...
  7. Replies
    18
    Views
    6,672

    Seem unable to use EOF?

    Okay, I tried rewriting this piece of code with getchar in the while loop to manually end the loop with EOF(Ctrl+Z)(I'm using Windows) It worked.

    However, any reasons as to why this doesn't work?...
  8. Repeated printing of a specific elements-sparse matrix addition?

    Hi! Here's my code for addition of two sparse matrices represented as a 3-tuple. The program adds up all elements in sparse matrices A and B and stores it in matrix C except that it repeats some...
  9. Replies
    7
    Views
    1,842

    Enlightenment!

    Anyway found my mistake. While exiting the for loop, movinghead became equal to NULL. So in the next loop, any reference to movinghead resulted in the compiler trying to access a NULL address...
  10. Replies
    7
    Views
    1,842

    I don't see anything wrong with that. It's not...

    I don't see anything wrong with that. It's not like I disrespect people's valuable feedback and opinions; its just that I sometimes like to have more than one viewpoints on a particular problem....
  11. Replies
    7
    Views
    1,842

    The first loop ends as soon as movinghead becomes...

    The first loop ends as soon as movinghead becomes NULL(which is the case for the last node in the list) By my logic, at this time, movinghead now points to the last element in the list. All I have...
  12. Replies
    7
    Views
    1,842

    It prints the elements of the list entered...

    It prints the elements of the list entered properly. But it doesn't print them in the reverse order as expected from the code starting at line 56. How should I modify it to print them in reverse?(if...
  13. Replies
    7
    Views
    1,842

    Help with Doubly Linked Lists!

    Here's a very primitive code for a doubly linked list. Although its only very rudimentary, whats wrong with this code? the code's supposed to print the elements sequentially starting from the first...
  14. Replies
    5
    Views
    11,033

    :)

    Ah you hit the nail on the head! Sometimes you just think so deep that you overlook the simpler things! That's why I saw a few anomalies while watching values of left,right,i,j,to name a few!...
  15. Replies
    5
    Views
    11,033

    Recursion and Quick Sort

    Hi! I've been studying quick sort. I stumbled across this piece of code:



    void quicksort(int arr[], int left, int right) {
    int i = left, j = right;
    int tmp;
    int pivot =...
  16. Replies
    16
    Views
    4,332

    No! I'm sure I didn't even touch anything else...

    No! I'm sure I didn't even touch anything else apart from changing float to int for that variable.(I mean, I 've tried doing every permutation to get to the bottom of this when I finally came at this...
  17. Replies
    16
    Views
    4,332

    I've found the problem. The float variable per is...

    I've found the problem. The float variable per is the problem. Replacing the type float in the structure with an int resolves the problem though I have no idea why this is so!
  18. Replies
    16
    Views
    4,332

    Whoa Whoa! I expected some educated answers; not...

    Whoa Whoa! I expected some educated answers; not condemnation for trying to learn C! I accepted that my code was not at all good, didn't I? But I only requested for some error to be pointed out to me...
  19. Replies
    16
    Views
    4,332

    Alright..I understand that my code is not so...

    Alright..I understand that my code is not so efficient(may be not at all). But shouldn't it give me the same result?(regardless how concise my code is) Could you point out any error in my code so I...
  20. Replies
    16
    Views
    4,332

    Okay now I get what was implied by a...

    Okay now I get what was implied by a 'comparator'. But how about swapping? How would you integrate a swapping routine with a comparator code(with respect to my program)?
  21. Replies
    16
    Views
    4,332

    Sorry! Was new to the site so thought of coloring...

    Sorry! Was new to the site so thought of coloring when I later found out about the code tag and then forgot to de-colorize the program!
    Okay I got the part about main.

    Could you be more specific?...
  22. Replies
    16
    Views
    4,332

    Help working with array of structures!

    Hi alll!
    I've created this C program(see attachments please) to accept names, roll numbers and percentages of 6 students. I've created an array of 6 structs each comprising above mentioned...
Results 1 to 22 of 22