public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* signed/unsigned char
@ 2005-07-20 14:46 Milena Constantino Caires
  2005-07-20 14:55 ` Eljay Love-Jensen
  2005-07-20 14:59 ` random
  0 siblings, 2 replies; 3+ messages in thread
From: Milena Constantino Caires @ 2005-07-20 14:46 UTC (permalink / raw)
  To: gcc-help


I would like to know why the following statements do not generate a
error during compiling but they do generate segmentation fault and
core dump when the program is running:


char* c = new char(1024);

or

u_char* c = new u_char(1024);

I know that the correct form of this memory allocation is "[1024]" and not
"(1024)" but sometimes it occurs by mistake.

The compiler is not supposed to complain about it???

Thanks in advance,
Milena

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-07-20 14:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-20 14:46 signed/unsigned char Milena Constantino Caires
2005-07-20 14:55 ` Eljay Love-Jensen
2005-07-20 14:59 ` random

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).