Re: Variable array size allocation
- From: adebaene@xxxxxxxxxxxxxxxx
- Date: 17 May 2005 08:19:19 -0700
boki a écrit :
> #include "stdio.h"
Add #include <stdlib.h> here.
>
> main()
> {
>
> int size=10;
> char* buffer = (char*)malloc(size*sizeof(char));
>
>
> }
Btw, you should learn to use the documentation that comes with your
compiler : malloc is clearly described in MSDN (look for the
"Requirement" paragraph).
Also, pick a good C introduction book, newsgroup are not well suited as
a teaching-from-scratch material.
Arnaud
MVP - VC
.
- Follow-Ups:
- Re: Variable array size allocation
- From: boki
- Re: Variable array size allocation
- References:
- Variable array size allocation
- From: boki
- Re: Variable array size allocation
- From: Nishant Sivakumar
- Re: Variable array size allocation
- From: boki
- Re: Variable array size allocation
- From: adebaene
- Re: Variable array size allocation
- From: boki
- Variable array size allocation
- Prev by Date: Re: Variable array size allocation
- Next by Date: Re: about OOP: how does a class in container know container's information?
- Previous by thread: Re: Variable array size allocation
- Next by thread: Re: Variable array size allocation
- Index(es):
Relevant Pages
|