From: Fabio <fabio@crearium.com>
To: linux-c-programming@vger.kernel.org
Subject: Dinamic array allocation
Date: Mon, 25 Oct 2004 21:03:02 -0600 [thread overview]
Message-ID: <417DBE66.7050501@crearium.com> (raw)
Hi.
I am programming a C code that gets argv[1] as the lenght of an array
that is the copy of an array plus more data.
So, the appication runs as: ./a.out 100
It create an array of 100 bytes and adds a static defined array plus
more data, like:
char *foo[5]="bar"
main(int argc, char *argv[])
{
char *Ptr[];
Ptr = malloc( argv[1]+strlen(foo));
....
}
Makes sense? guess no.
Any suggestion is welcome.
thanks in advance
next reply other threads:[~2004-10-26 3:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-26 3:03 Fabio [this message]
2004-10-26 4:09 ` Dinamic array allocation Ron Michael Khu
2004-10-26 4:12 ` Ron Michael Khu
2004-10-26 4:59 ` Lejanson C. Go
2004-10-26 5:15 ` Ron Michael Khu
2004-10-26 5:51 ` Glynn Clements
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=417DBE66.7050501@crearium.com \
--to=fabio@crearium.com \
--cc=linux-c-programming@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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 NNTP newsgroup(s).