Gamestudio Links
Zorro Links
Newest Posts
Help with plotting multiple ZigZag
by degenerate_762. 04/30/24 23:23
M1 Oversampling
by 11honza11. 04/30/24 08:16
Trading Journey
by howardR. 04/28/24 09:55
Zorro Trader GPT
by TipmyPip. 04/27/24 13:50
Data from CSV not parsed correctly
by jcl. 04/26/24 11:18
Why Zorro supports up to 72 cores?
by jcl. 04/26/24 11:09
Eigenwerbung
by jcl. 04/26/24 11:08
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
2 registered members (degenerate_762, AndrewAMD), 877 guests, and 5 spiders.
Key: Admin, Global Mod, Mod
Newest Members
wandaluciaia, Mega_Rod, EternallyCurious, howardR, 11honza11
19049 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 2 of 5 1 2 3 4 5
Re: A8 Version 8.012 Public Beta [Re: bart_the_13th] #333131
07/14/10 08:32
07/14/10 08:32
Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
install directx and up-to-date video drivers.

Last edited by Quadraxas; 07/14/10 08:32.

3333333333
Re: A8 Version 8.012 Public Beta [Re: Quad] #333159
07/14/10 13:50
07/14/10 13:50
Joined: Dec 2008
Posts: 1,218
Germany
Rackscha Offline
Serious User
Rackscha  Offline
Serious User

Joined: Dec 2008
Posts: 1,218
Germany
@JCL:
Thought for the support i need a support ticket from the shop?(cant find it).

Here is the code, short,simple laugh

Code:
#include<acknex.h>



int **array;


function main()
{
	int counter = 0;
array = (int**)sys_malloc(sizeof(int*)*10);	
for(counter=0;counter<=10;counter++)
{
	array[counter] = (int*)sys_malloc(sizeof(int)*10);
}
//array[1][1] = 5; Dimension of array error. This SHOULD work, but doesnt in Lite-c
(array[1])[1] = 5;	//Thats the only way it works with Lite-c
}



GReets
Rackscha

Last edited by Rackscha; 07/14/10 13:53.

MY Website with news of my projects:
(for example my current
Muliplayer Bomberman,
GenesisPrecompiler for LiteC
and TileMaster, an easy to use Tile editor)
Sparetime-Development

Re: A8 Version 8.012 Public Beta [Re: Rackscha] #333170
07/14/10 14:53
07/14/10 14:53
Joined: Jul 2000
Posts: 27,986
Frankfurt
jcl Offline OP

Chief Engineer
jcl  Offline OP

Chief Engineer

Joined: Jul 2000
Posts: 27,986
Frankfurt
A little user quiz: Who shows Rakscha what's wrong with his "array"?

Re: A8 Version 8.012 Public Beta [Re: jcl] #333172
07/14/10 15:04
07/14/10 15:04
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
Well, he allocates too much memory and I think the style is ugly.
But this isn't his point, his point is the assigning of the array.

Oh and btw, my wish: C99 style for loops!


Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: A8 Version 8.012 Public Beta [Re: WretchedSid] #333173
07/14/10 15:10
07/14/10 15:10
Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
Quad Offline
Senior Expert
Quad  Offline
Senior Expert

Joined: Oct 2007
Posts: 5,210
Ä°stanbul, Turkey
If you are going to look in this stuff, please also look in ternary operators while you are at it.


3333333333
Re: A8 Version 8.012 Public Beta [Re: Quad] #333174
07/14/10 15:15
07/14/10 15:15
Joined: Jul 2009
Posts: 1,198
Berlin, Germany
L
Liamissimo Offline
Serious User
Liamissimo  Offline
Serious User
L

Joined: Jul 2009
Posts: 1,198
Berlin, Germany
He forgot the definition of the array or not?

I just guessed, not good at quizzes grin


"Ich weiss nicht genau, was Sie vorhaben, aber Sie können keine Triggerzonen durch Ihr Level kullern lassen."
-JCL, 2011
Re: A8 Version 8.012 Public Beta [Re: Liamissimo] #333175
07/14/10 15:20
07/14/10 15:20
Joined: Dec 2008
Posts: 1,218
Germany
Rackscha Offline
Serious User
Rackscha  Offline
Serious User

Joined: Dec 2008
Posts: 1,218
Germany
@JustSid:
With too much memory, do you mean cause i used only [1][1] or did i something in general wrong?(if its the first case, its just and example laugh )


GReets
Rackscha


MY Website with news of my projects:
(for example my current
Muliplayer Bomberman,
GenesisPrecompiler for LiteC
and TileMaster, an easy to use Tile editor)
Sparetime-Development

Re: A8 Version 8.012 Public Beta [Re: Rackscha] #333176
07/14/10 15:33
07/14/10 15:33
Joined: Apr 2007
Posts: 3,751
Canada
WretchedSid Offline
Expert
WretchedSid  Offline
Expert

Joined: Apr 2007
Posts: 3,751
Canada
I'm talking about your for loop:
Code:
for(counter=0;counter<=10;counter++)


you are allocating place for 10 integer pointers, but then you try to assign 11 pointers something.

@TheLiam:
Of course he has an array. He allocates the memory for the array at runtime and assigns some value to the array. It's described here in detail: http://c-faq.com/aryptr/dynmuldimary.html

Edit: Second wish: Please build variable argument lists into the compiler.

Last edited by JustSid; 07/14/10 15:34.

Shitlord by trade and passion. Graphics programmer at Laminar Research.
I write blog posts at feresignum.com
Re: A8 Version 8.012 Public Beta [Re: WretchedSid] #333177
07/14/10 15:52
07/14/10 15:52
Joined: Dec 2008
Posts: 1,218
Germany
Rackscha Offline
Serious User
Rackscha  Offline
Serious User

Joined: Dec 2008
Posts: 1,218
Germany
@JustSid: ou year, my bad. Ofcourse wrong^^


MY Website with news of my projects:
(for example my current
Muliplayer Bomberman,
GenesisPrecompiler for LiteC
and TileMaster, an easy to use Tile editor)
Sparetime-Development

Re: A8 Version 8.012 Public Beta [Re: Rackscha] #333182
07/14/10 16:57
07/14/10 16:57
Joined: May 2007
Posts: 2,043
Germany
Lukas Offline

Programmer
Lukas  Offline

Programmer

Joined: May 2007
Posts: 2,043
Germany
I don't see any error apart from that <=10 either, and I have to agree about the ugly brackets. Something seems to be wrong with the operator priorities of Lite-C. I have encountered stuff like this, too. For example:

ebx->text->pstring[0] // does not work
(ebx->text->pstring)[0] // works, but looks ugly

In "normal" C/C++ code, you don't need those brackets. Look at the operator priorities:
http://en.wikipedia.org/wiki/Operators_in_C_and_C%2B%2B#Operator_precedence
The operators "->" and "[]" have the same priorotity and the associativity is from left to right. This means, the "->" in my code above has to be "called" first, which means the [0] refers to "ebx->text->pstring" and nothing else. And I'm wondering what Lite-C tries to make it refer to...

Same for Rackscha's code. The first [] brackets should have a higher priority making the brackets unnecessary.

And now that we are talking about flaws of the Lite-C compiler, could you please answer to this thread:
http://www.opserver.de/ubb7/ubbthreads.php?ubb=showflat&Number=330463#Post330463

Page 2 of 5 1 2 3 4 5

Moderated by  Matt_Coles 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1