1 registered members (AbrahamR),
717
guests, and 4
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
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
Senior Expert
|
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
Serious User
|
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
#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: jcl]
#333172
07/14/10 15:04
07/14/10 15:04
|
Joined: Apr 2007
Posts: 3,751 Canada
WretchedSid
Expert
|
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
Senior Expert
|
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
Liamissimo
Serious User
|
Serious User
Joined: Jul 2009
Posts: 1,198
Berlin, Germany
|
He forgot the definition of the array or not? I just guessed, not good at quizzes
"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
Serious User
|
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 ) 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
Expert
|
Expert
Joined: Apr 2007
Posts: 3,751
Canada
|
I'm talking about your for loop:
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.htmlEdit: 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
Serious User
|
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
Programmer
|
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
|
|
|
|