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 - Multi-dim Arrays

Multi-dim Arrays

A PocketC native palm library offering native forms and assorted utilities

Postby WauloK on Mon Jul 22, 2002 12:11 am

From the examples given, this seems to be correct, but PDE won't compile it:

pointer Data;
Data=Array("c,40,24");
char Data[40][24];

I get 'syntax error in declaration' pointing at the "c
I have #library "PToolboxLib" at the start.
This is a global declaration.

Funky groovy PocketC support site.
http://pocketc.bangrocks.com/
Iron Filings v2.0 released.
Download a demo version at http://www.palmgear.com
Made with PocketC!
Funky groovy PocketC support site.
http://pocketc.bangrocks.com/
Iron Filings v2.0 released.
Download a demo version at http://www.palmgear.com
Made with PocketC!
WauloK
 
Posts: 232
Joined: Tue Jan 15, 2002 2:41 am
Location: Australia

Postby WauloK on Mon Jul 22, 2002 12:29 am

Slight change.

pointer Data;
main()
{
char Data[40][24];
Data=Array("c,40,24");

Now I get 'syntax error in declaration' at the 24.


Funky groovy PocketC support site.
http://pocketc.bangrocks.com/
Iron Filings v2.0 released.
Download a demo version at http://www.palmgear.com
Made with PocketC!
Funky groovy PocketC support site.
http://pocketc.bangrocks.com/
Iron Filings v2.0 released.
Download a demo version at http://www.palmgear.com
Made with PocketC!
WauloK
 
Posts: 232
Joined: Tue Jan 15, 2002 2:41 am
Location: Australia

Postby jstadolnik on Mon Jul 22, 2002 12:32 am

Under the hood, Array() calls the PocketC malloc function... so the data is dynamically allocated. Thus there is no need for a variable declaration statement beyond the required pointer.

With regards to the "char Data[40][24]"...
1) As in C, function calls cannot occur before variable declarations.
2) PocketC doesn't support true multi-dimensional arrays. See the "Pointers and arrays" section of the full pocketC manual for how these array types are faked out... or Wolfgang's multi-dimensional array source code (http://pages.prodigy.net/gwen.and.wolfg ... urces.html).

Joe



The PToolboxLib guy.
http://www.geocities.com/retro_01775/PToolboxLib.htm
jstadolnik
 
Posts: 1741
Joined: Wed Dec 06, 2000 3:34 am
Location: USA

Postby WauloK on Mon Jul 22, 2002 1:16 am

ok got it working tnx

Funky groovy PocketC support site.
http://pocketc.bangrocks.com/
Iron Filings v2.0 released.
Download a demo version at http://www.palmgear.com
Made with PocketC!
Funky groovy PocketC support site.
http://pocketc.bangrocks.com/
Iron Filings v2.0 released.
Download a demo version at http://www.palmgear.com
Made with PocketC!
WauloK
 
Posts: 232
Joined: Tue Jan 15, 2002 2:41 am
Location: Australia


Return to Pocket Toolbox

Who is online

Users browsing this forum: No registered users and 1 guest

cron