Added: 2 years ago
From: netcore2k
Views: 8,715
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:
see all

All Comments (12)

Sign In or Sign Up now to post a comment!
  • can anybody think of a logical reason why i cant do "int* a,b;" and have them both be pointers?

  • @jony1710 try "int *a, *b;" i think with "int* a,b;" you are only assigning a as a pointer and not b...

  • @jamesllewellyn19 ahh thanks man, that makes complete sense. happy 2012. :)

  • at the end dnt do

    delete x;

    delete y; // this will be a big problem

    so always do

    delete x;

    x = NULL;

    if(!y) delete y;

  • @zfjquery That doesn't work either.

  • @gsvick

    if you delete any pointer twice you will get error . setting it to null is important after deleting so next time you can check before deleting the same pointer if null then dont delete.

  • @zfjquery Except you don't set y to null, just x. And the condition tests whether y is null and only then tries to delete it, which doesn't make any sense.

    So, your code as written actually works, but doesn't make any sense and will be “a big problem” when used in any program that has more than 10 lines of code.

  • This is great, thanks' a bunch man ;)

  • yo des jambas b brash!

  • uhh, yeah sharing whatever...

  • haha, awesome!

  • embarrassingly, this really helped... thanks :D

Loading...
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more