Help: need c code that get my memory size

This is a discussion on Help: need c code that get my memory size within the C Programming forums, part of the General Programming Boards category; hey everyone i need a code that get memory size in the end of code : printf("your memory size is:%l",size); ...

  1. #1
    Registered User
    Join Date
    Jul 2013
    Posts
    7

    Help: need c code that get my memory size

    hey everyone

    i need a code that get memory size

    in the end of code : printf("your memory size is:%l",size);

    and thank for all

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,558
    You need to tell us which Operating system and compiler you're using.

    Of course, if your machine implements virtual memory, then you need to be very specific about what you mean by "memory size".
    It could mean several different things, depending on your point of view.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Registered User
    Join Date
    Jul 2013
    Posts
    7
    i have windows 7 64 bit and i use visual studio 2010

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,558
    https://www.google.co.uk/search?q=win32+get+memory+size
    Try it with similar searches, like "get virtual memory size" etc.

    > and i use visual studio 2010
    Does this know about the 64-bit API of your OS?
    If you're trying to get detailed info from the OS, you NEED a compiler that is fully compatible with that OS (and not just capable of generating userland processes in some compatibility mode).

    I suppose it could be worse, you could have been trying to do this from TurboC
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  5. #5
    - - - - - - - - oogabooga's Avatar
    Join Date
    Jan 2008
    Posts
    2,808
    Last edited by oogabooga; 07-21-2013 at 03:27 PM.

  6. #6
    Registered User
    Join Date
    Jul 2013
    Location
    Germany
    Posts
    468
    This might work. I have not used visual studio for other then Visual Basic before. Try using:

    printf("The storage size of each array element is: %d\n",
    sizeof(int));

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. INT 15 to return memory size
    By pole1080 in forum C Programming
    Replies: 49
    Last Post: 06-23-2010, 09:28 AM
  2. Available memory size
    By Opariti in forum Windows Programming
    Replies: 17
    Last Post: 10-06-2009, 01:06 AM
  3. Size of objects in Memory
    By Doorsdown in forum C Programming
    Replies: 20
    Last Post: 05-30-2007, 02:30 AM
  4. help with memory size
    By cBegginer in forum C Programming
    Replies: 3
    Last Post: 03-19-2006, 09:28 AM
  5. Memory size
    By a_learner in forum C Programming
    Replies: 4
    Last Post: 10-08-2001, 08:10 PM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21