From: "Quang Nguyen (Ngo)" <quang.nguyen@tapeware.com>
To: 'Jason Mancini' <jayrusman@hotmail.com>, gcc-help@gcc.gnu.org
Subject: RE: How to pass 2D variable-sized arrays in C++?
Date: Thu, 26 Sep 2002 08:33:00 -0000 [thread overview]
Message-ID: <E50A109EE98AA049BAA09D725DB0714F38A874@yt-internet.tapeware.com> (raw)
Hi Jason,
Try this:
void func(int c, int r, float f[][])
{
printf("hello\n");
}
main()
{
int c = 5, r = 7;
float f[r][c];
func(c, r, f);
}
--
Quang
-----Original Message-----
From: Jason Mancini [mailto:jayrusman@hotmail.com]
Sent: Wednesday, September 25, 2002 7:37 PM
To: gcc-help@gcc.gnu.org
Subject: How to pass 2D variable-sized arrays in C++?
Hello,
How does one type the 2D variable size array "f" below?
I've tried nasty casts that all get rejected, cheating
with void, etc, etc. Very stumped! Sure, I could back
up to a real float** and manually new[] and pass float**,
but that takes all the fun out!
Thanks,
Jason
void function(int c, int r, ??? f )
{
}
main() {
int c(5), r(7);
float f[r][c];
function(c, r, f);
};
--
_________________________________________________________________
Join the world's largest e-mail service with MSN Hotmail.
http://www.hotmail.com
________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs SkyScan
service. For more information on a proactive anti-virus service working
around the clock, around the globe, visit http://www.messagelabs.com
________________________________________________________________________
________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs SkyScan
service. For more information on a proactive anti-virus service working
around the clock, around the globe, visit http://www.messagelabs.com
________________________________________________________________________
next reply other threads:[~2002-09-26 15:33 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-09-26 8:33 Quang Nguyen (Ngo) [this message]
2002-09-26 12:14 ` OT: " Claudio Bley
-- strict thread matches above, loose matches on Subject: below --
2002-09-30 14:48 Jason Mancini
2002-09-30 18:46 ` Claudio Bley
2002-10-01 4:59 ` John Love-Jensen
2002-10-01 6:04 ` Claudio Bley
2002-10-01 6:21 ` John Love-Jensen
2002-10-01 6:45 ` Claudio Bley
2002-09-26 14:29 Jason Mancini
2002-09-25 19:36 Jason Mancini
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=E50A109EE98AA049BAA09D725DB0714F38A874@yt-internet.tapeware.com \
--to=quang.nguyen@tapeware.com \
--cc=gcc-help@gcc.gnu.org \
--cc=jayrusman@hotmail.com \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).