Datasim Financial Forums Forum Index


 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
2. Pointers and Memory

 
Post new topic   Reply to topic    Datasim Financial Forums Forum Index -> C++ Certification and Examinations: Intermediate Level
View previous topic :: View next topic  
Author 2. Pointers and Memory
Cuchulainn



Joined: 18 Dec 2006
Posts: 461
Location: Amsterdam, the Netherlands

PostPosted: Mon Dec 28, 2009 2:37 pm    Post subject: Reply with quote

int* m;
delete m;

int* n = new int;
delete n;
delete n;

int* p = new int[20];
delete p;

int* q = new int[20];
delete q;
delete [] q;


int* t = new int[20];
delete [] t;
delete t;

{
int* r = new int;
}

int* p1 = p1;
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Cuchulainn



Joined: 18 Dec 2006
Posts: 461
Location: Amsterdam, the Netherlands

PostPosted: Wed Jan 28, 2009 10:56 am    Post subject: Reply with quote

Is the boost scoped_ptr a 'better' auto_ptr?

Is scope_ptr ~ const auto_ptr?
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Excel4Net



Joined: 26 Dec 2008
Posts: 8

PostPosted: Wed Jan 28, 2009 2:24 am    Post subject: Re: 2. Pointers and Memory Reply with quote

What is the auto_ptr? When would you use auto_ptr instead of a pointer?

What is the benefits of using auto_ptr compared tp shared_ptr of the Boost library?

What is the caveats of using auto_ptr?

_________________
Excel4Net (www.excel4net.com) - the easy way to get your Excel spreadsheet talking to your .NET code.
Back to top
View user's profile Send private message Visit poster's website
Cuchulainn



Joined: 18 Dec 2006
Posts: 461
Location: Amsterdam, the Netherlands

PostPosted: Wed Jan 21, 2009 12:03 pm    Post subject: 2. Pointers and Memory Reply with quote

What is stack, heap and static memory?

Describe how to create heap-based objects, avoiding the common problems that novices have with raw pointers.

What is

double** mat;
double* mat[10];
double mat[10][20];

How would you initialise the matrix in each case; how do you manage memory?

//
??
pointe vs reference
dereferencing
null pointer
uninitialised pointer
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Datasim Financial Forums Forum Index -> C++ Certification and Examinations: Intermediate Level All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group