Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19

Warning: Function ereg() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 4

Warning: Function split() is deprecated in ..../includes/class_postbit.php(345) : eval()'d code on line 19
Return value of memory allocation ? - Page 2
Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: Return value of memory allocation ?

  1. #11
    Senior Member
    Join Date
    Jul 2001
    Posts
    280

    Re: Return value of memory allocation ?

    So there is no difference between these two lines:
    Code:
    myclass->mymethod();
    (*myclass).mymethod();
    ...other than preference or readability. *There is no technical reason I should use one over the other.

    And I can treat this
    Code:
    ...
    int *ptr;
    ...
    ptr= new int[size];
    ...
    ...just like any other normal array.

    Sorry about belaboring the point. *I just want to make sure I have this correct.

  2. #12
    Guest

    Re: Return value of memory allocation ?

    So there is no difference between these two lines:
    Code:
    myclass->mymethod();
    (*myclass).mymethod();
    ...other than preference or readability. There is no technical reason I should use one over the other.
    Yes, there's no difference at all, but the first one is preferred as there's less typing, but you can't do pointer arithmetic with the first one.

    And I can treat this
    Code:
    ...
    int *ptr;
    ...
    ptr= new int[size];
    ...
    ...just like any other normal array.

    Sorry about belaboring the point. I just want to make sure I have this correct.
    Yep, you got it. Pointers can also be accessed as arrays.

Similar Threads

  1. About Space allocation
    By ubunfan in forum Linux - General Topics
    Replies: 2
    Last Post: 07-22-2011, 04:58 AM
  2. The Return of cga
    By cga in forum General Chat
    Replies: 2
    Last Post: 12-18-2005, 01:21 AM
  3. Freeing ext3 file allocation blocks
    By gabbath in forum Linux - General Topics
    Replies: 0
    Last Post: 11-14-2005, 08:02 PM
  4. The Return of Il Duce
    By jman_77 in forum General Chat
    Replies: 4
    Last Post: 04-27-2002, 03:07 AM
  5. Return to Castle Wolfenstein Singleplayer
    By in forum Linux - Software, Applications & Programming
    Replies: 6
    Last Post: 01-20-2002, 01:50 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •