Can I create an array of char with "new"? 
Author Message
 Can I create an array of char with "new"?

I need to create an array of char, and I type a statement like this:

char *meta = new char[500];

but it seems like "new" only can to allocate 256 bytes of memory or less,
because, when I execution that statement, "meta" only can hold 256
charactes, like if I write something like this:

char *meta = new char[256];

I really need to create an array with more than 256 characters, and I would
thank a lot if somebody gives me any kind of help.

Please, help me!!!  It's very important.



Sun, 24 Jul 2005 04:23:56 GMT  
 Can I create an array of char with "new"?
There is no problem in allocating large arrays.
Are you sure your index variable is not a byte type?
Quote:

> I need to create an array of char, and I type a statement like this:

> char *meta = new char[500];

> but it seems like "new" only can to allocate 256 bytes of memory or less,
> because, when I execution that statement, "meta" only can hold 256
> charactes, like if I write something like this:

> char *meta = new char[256];

> I really need to create an array with more than 256 characters, and I would
> thank a lot if somebody gives me any kind of help.

> Please, help me!!!  It's very important.



Sun, 24 Jul 2005 04:53:08 GMT  
 Can I create an array of char with "new"?
Answered in vc.language.  Please don't multipost, instead crosspost if
appropriate.

[snip]

--
Craig Powers
MVP - Visual C++



Sun, 24 Jul 2005 06:45:24 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Help with compiling a "canned" program

2. how to "new" 2d array

3. char foo[]=""; vs char* foo="";

4. char a[] = "abc"; char* a = "abc";

5. Difference between "char *arr" and "char arr[]"

6. difference between "char*" and "const char*"

7. decode/unescape "%uxxxx" char in VC++

8. char a[] = ("x");

9. Any != between (char) NULL and ""

10. is this allowed char *name = "bryan"

11. Delete "/" from char pointer

12. What is "unsigned char data[0];"

 

 
Powered by phpBB® Forum Software