Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3368: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3370: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3371: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3372: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
OrbWorks Community Forum • View topic - About the Multi-Dimensional Arrays

About the Multi-Dimensional Arrays

Discuss PocketC for CE (including Desktop Edition)

Postby David on Tue Jun 05, 2001 2:08 am

Hi,
why doesn't the following codes work with MDA?

#include "/PocketC/array.pc"
#define ROWS 3
#define COLUMNS 4
main()
{
int i,j;
pointer ptr;
ptr=array("i,2,ROWS,COLUMNS");

for(i=0;i<ROWS;i++)
{
for(j=0;J<COLUMNS;J++)
{
ptr[i][j]=(i+1)*(j+1);
}
}

putsl(*(ptr[2]+3));

}
David
 
Posts: 26
Joined: Sat Jun 02, 2001 1:14 pm

Postby David on Tue Jun 05, 2001 2:16 am

sorry,repost the codes:

#include "/PocketC/array.pc"
#define ROWS 3
#define COLUMNS 4
main()
{
int i,j;
pointer ptr;
ptr=array("i,2,ROWS,COLUMNS");
for(i=0;i<ROWS;i++)
{
for(j=0;j<COLUMNS;j++)
{
ptr[i][j]=(i+1)*(j+1);
}
}
putsl(*(ptr[2]+3));
}

Any comments will be appreciated.

-David
David
 
Posts: 26
Joined: Sat Jun 02, 2001 1:14 pm

Postby brendan on Tue Jun 05, 2001 4:48 am

I'm not seeing where your going with the code ???

try somthing like:

#include "/PocketC/array.pc"
#define ROWS 3
#define COLUMNS 4
main()
{
int i,j;
pointer ptr;
ptr=array("i,2,ROWS,COLUMNS");
for(i=0;i < ROWS; i++)
{
for(j=0;j < COLUMNS; j++)
{
ptr[i][j]=(i+1)*(j+1);
}
}
putsl(ptr[2][3]);
}

or somthing to that effect, unless you can explain what you were trying to do with the code, I don't even know if what you had would compile ?, and don't forget to unallocate the memory for the array.

-brendan :)
brendan
 
Posts: 114
Joined: Tue Feb 20, 2001 2:28 am

Postby wolfgang on Tue Jun 05, 2001 4:29 pm

Hello,

here's the author of the array code :-)

Your mistake is the following:
If you write ROWS and COLUMNS within quotation marks, PocketC takes this a literal texts, not as the constants ROWS and COLUMN that you defined in the beginning.
I attached the corrected code below.

Wolfgang


#include "/PocketC/array.pc"
#define ROWS 3
#define COLUMNS 4
main()
{
int i,j;
pointer ptr;
ptr=array("i,2," + ROWS + "," + COLUMNS);
for(i=0;i{
for(j=0;j{
ptr[i][j]=(i+1)*(j+1);
}
}
putsl(*(ptr[2]+3));
}
Composing music on the PocketPC! - http://www.pdamusician.com
wolfgang
 
Posts: 281
Joined: Tue Dec 12, 2000 4:22 am
Location: USA

Postby brendan on Tue Jun 05, 2001 10:41 pm

elementry, why diden't I see that, BTW thanks wolfgang for the array.pc code, I used it in squish....

-brendan
brendan
 
Posts: 114
Joined: Tue Feb 20, 2001 2:28 am

Postby David on Wed Jun 06, 2001 9:57 pm

hey,wolfgang
It works fine with your codes,thanks for your useful liberary:)
-David
David
 
Posts: 26
Joined: Sat Jun 02, 2001 1:14 pm


Return to PocketC for CE

Who is online

Users browsing this forum: No registered users and 2 guests

cron