Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C Moderated > Re: Confusion o...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 13 Topic 1067 of 1134
Post > Topic >>

Re: Confusion of Malloc and Sizeof

by Chris McDonald <chris@[EMAIL PROTECTED] > Mar 30, 2008 at 02:58 PM

shofu_au@[EMAIL PROTECTED]
 writes:

>How do you determine the number of elements in a dynamically allocated
>variable, without passing the number or having a global variable.

You cannot.
Your code will need to remember it in a variable.

-- 
Chris.
-- 
comp.lang.c.moderated - moderation address: clcm@[EMAIL PROTECTED]
 -- you must
have an appropriate newsgroups line in your header for your mail to be
seen,
or the newsgroup name in square brackets in the subject line.  Sorry.
 




 13 Posts in Topic:
Confusion of Malloc and Sizeof
shofu_au@[EMAIL PROTECTED  2008-03-28 19:20:27 
Re: Confusion of Malloc and Sizeof
=?ISO-8859-1?Q?Hans-Bernh  2008-03-30 14:58:44 
Re: Confusion of Malloc and Sizeof
Chris McDonald <chris@  2008-03-30 14:58:13 
Re: Confusion of Malloc and Sizeof
Carl Barron <cbarron41  2008-03-30 14:58:26 
Re: Confusion of Malloc and Sizeof
=?utf-8?Q?Dag-Erling_Sm=C  2008-03-30 14:58:47 
Re: Confusion of Malloc and Sizeof
Jack Klein <jackklein@  2008-03-30 14:58:24 
Re: Confusion of Malloc and Sizeof
Barry Schwarz <schwarz  2008-03-30 14:58:33 
Re: Confusion of Malloc and Sizeof
Thomas Richter <thor@[  2008-03-30 14:58:41 
Re: Confusion of Malloc and Sizeof
Erik Trulsson <ertr101  2008-03-30 14:58:35 
Re: Confusion of Malloc and Sizeof
gordonb.lbk55@[EMAIL PROT  2008-03-30 14:58:18 
Re: Confusion of Malloc and Sizeof
Ulrich Eckhardt <dooms  2008-03-30 14:58:29 
Re: Confusion of Malloc and Sizeof
jgd@[EMAIL PROTECTED] (J  2008-03-30 14:58:38 
Re: Confusion of Malloc and Sizeof
Barry Schwarz <schwarz  2008-03-30 14:58:33 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Jul 25 15:58:23 CDT 2008.