Linux -Blue forest free software | Return to home page | Site Map | Search WWW | Contact Us |
Your current position : Homepage > Free Software > Technological exchanges >Application Programming


    

Blue Forest http://www.lslnet.com at 10:18 on June 6, 2006


Malloc ()?

Dear friends, I used the C language, we ask questions, I think the definition of a one million records storage array using malloc () function changed how I defined? Array is the char type. Thank you!

Malloc ()?

You need to first calculate how much virtual memory

Malloc ()?

Man malloc

In addition, the C language carefully to understand memory allocation and management of the knowledge bar.

Malloc ()?

#include "Stdio.h>;
#inlcude "Stdllib.h>;
# MAXLEN 1024
Main ()
{
The size of each array */ char caStr[MAXLEN]; LEAVES OF 13 SPECIES OF LAURACEAE
Int iNum = 1000; LEAVES OF 13 SPECIES OF LAURACEAE need storage array number */
Char *p;
   
P = malloc (MAXLEN*iNum);
If (p ====== NULL)
    {
Perror ( "Memory allocation failed !\n");
    }
}

Malloc ()?

100MB should be within. Thank you upstairs.

Malloc ()?

Really serious



 Privacy Policy  Copyright © 1999-2000 LSLNET.COM. All rights reserved. Blue Forest website owners. E-mail : Webmaster@lslnet.com