linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Dinamic array allocation
@ 2004-10-26  3:03 Fabio
  2004-10-26  4:09 ` Ron Michael Khu
  2004-10-26  5:51 ` Glynn Clements
  0 siblings, 2 replies; 6+ messages in thread
From: Fabio @ 2004-10-26  3:03 UTC (permalink / raw)
  To: linux-c-programming

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

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

end of thread, other threads:[~2004-10-26  5:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-26  3:03 Dinamic array allocation Fabio
2004-10-26  4:09 ` 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

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).