Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Size of allocated portion of memory...

This is a discussion on Size of allocated portion of memory... within the C and C++ forums, part of the Software Development category; How can we determine the size of allocated portion of memory ? Is there any way to crack the "free()" determines the size of allocated memory ?...

Go Back   Geeks Talk > Software Development > C and C++
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read
  #1 (permalink)  
Old 04-30-2009
Junior Member
 
Join Date: Apr 2009
Posts: 3
Thanks: 0
Thanked 1 Time in 1 Post
srinivasdivi is on a distinguished road
Question Size of allocated portion of memory...

How can we determine the size of allocated portion of memory ? Is there any way to crack the "free()" determines the size of allocated memory ?
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 05-19-2009
Junior Member
 
Join Date: May 2009
Posts: 5
Thanks: 2
Thanked 0 Times in 0 Posts
VENKATGOPU is on a distinguished road
Re: Size of allocated portion of memory...

you can determine the size of allocated memory by using sizeof() keyword.

e.g.
if you will allocate memory using new() keyword

int *p=new int[10]; //Memory dynamically allocated

you can determine the size of allocated memory using sizeof() keyword

int sz=sizeof(p);

you can delete dynamically allocated memory using delete keyword

delete []p;


Thanks & Regards
Venkat Gopu
Reply With Quote
  #3 (permalink)  
Old 05-21-2009
Junior Member
 
Join Date: May 2009
Location: Bangalore
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
jagadish12 is on a distinguished road
Re: Size of allocated portion of memory...

Quote:
Originally Posted by srinivasdivi View Post
How can we determine the size of allocated portion of memory ? Is there any way to crack the "free()" determines the size of allocated memory ?
There is command called size which shows you the memory allocated for a particular section(Data, Text and other shared sections).
You can just use this command to see the size of your a.out file..
Reply With Quote
Reply

  Geeks Talk > Software Development > C and C++

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
array size and transaction size in datastage bhanutej Data Warehousing 0 06-26-2008 01:57 AM
Memory size occupied by object ravitcs Java 1 02-05-2008 12:33 AM
MemoryCleaner performs fast and powerful memory sweep, removing wasted memory blocks, JobHelper Geeks Lounge 0 10-06-2007 06:13 AM
Deallocating dynamically allocated heap JobHelper C and C++ 4 07-25-2007 05:38 AM
Exam, Portion and Institutes for Aeronautics Test suruchi Career Advice 0 05-13-2007 01:46 AM


All times are GMT -4. The time now is 01:46 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2005 - 2010 GeekInterview.com. All Rights Reserved