Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > multi dimensional array example

Reply
Thread Tools

multi dimensional array example

 
 
Skybuck Flying
Guest
Posts: n/a
 
      11-24-2006
Hello,

How to convert this Delphi code for Win32 to C or C++ Win32 code ?

var
vArray : array of array of array of integer;

x,y,z : integer;

begin
SetLength( vArray, 200, 200, 200 );

for x := 0 to 199 do
begin
for y := 0 to 199 do
begin
for z := 0 to 199 do
begin
vArray[ x, y, z ] := 123456789;
end;
end;
end;

vArray := nil;
end;

Bye,
Skybuck.



 
Reply With Quote
 
 
 
 
Richard Heathfield
Guest
Posts: n/a
 
      11-24-2006
Skybuck Flying said:

> Hello,
>
> How to convert this Delphi code for Win32 to C or C++ Win32 code ?


You could start by apologising for your systematic and prolonged Usenet
abuse over several years. People aren't usually all that interested in
helping trolls with technical problems.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
 
Reply With Quote
 
 
 
 
Skybuck Flying
Guest
Posts: n/a
 
      11-24-2006

"Richard Heathfield" <> wrote in message
news:...
> Skybuck Flying said:
>
>> Hello,
>>
>> How to convert this Delphi code for Win32 to C or C++ Win32 code ?

>
> You could start by apologising for your systematic and prolonged Usenet
> abuse over several years. People aren't usually all that interested in
> helping trolls with technical problems.


I don't ever apologise to incompetent fools like you.

Bye,
Skybuck.


 
Reply With Quote
 
Richard Heathfield
Guest
Posts: n/a
 
      11-24-2006
Skybuck Flying said:

>
> "Richard Heathfield" <> wrote in message
> news:...
>> Skybuck Flying said:
>>
>>> Hello,
>>>
>>> How to convert this Delphi code for Win32 to C or C++ Win32 code ?

>>
>> You could start by apologising for your systematic and prolonged Usenet
>> abuse over several years. People aren't usually all that interested in
>> helping trolls with technical problems.

>
> I don't ever apologise to incompetent fools like you.


That figures. Just a couple of points, though, before I leave you to your
cess-pool of abuse: someone who can't do what you're asking to do - e.g.
you - is incompetent, and someone who insults those from whom he seeks help
- e.g. you - is a fool. The wise are not overly concerned by the opinions
of such people.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
 
Reply With Quote
 
Skybuck Flying
Guest
Posts: n/a
 
      11-24-2006

"Skybuck Flying" <> wrote in message
news:ek6kip$pv3$...
> First I stick my big dick in your mouth so you have something to chew on
> since you obviously need it to shut up your nagging foul mouth
>
> And after I do that I post my solution which you obviously lack.
>
> This code nicely demonstrates the different access times for RAM chips
> depending on index order/memory layout <- which is much more clear in my
> equally competent delphi code.
>
> // ArrayAccessTest.cpp : Defines the entry point for the console
> application.
> //
> #include "stdafx.h"
> #include "windows.h"
> #include "stdlib.h"
> int _tmain(int argc, _TCHAR* argv[])
> {
> //int ***vArray;
> int Tick1;
> int Tick2;
> int Interval;
> int x,y,z;
> int *vArray = new int[200*200*200];
> Tick1 = GetTickCount();
> for (x=0; x<199; x++)
> {
> for (y=0; y<199; y++)
> {
> for (z=0; z<199; z++)
> {
> vArray[x+y*200+z*200*200] = 123456789;
> }
> }
> }
> Tick2 = GetTickCount();
> Interval = Tick2 - Tick1;
> printf("%d\n", Interval );
> Tick1 = GetTickCount();
> for (x=0; x<199; x++)
> {
> for (y=0; y<199; y++)
> {
> for (z=0; z<199; z++)
> {
> vArray[x*200*200+y*200+z] = 123456789;
> }
> }
> }
> Tick2 = GetTickCount();
> Interval = Tick2 - Tick1;
> printf("%d\n", Interval );


// oopsy little mistake:
free( vArray );

// has to be, just like in my old code:
delete []vArray;

^^^
probably more safe...

> getchar();
> return 0;
> }
>
> Gosh I even had to boot up my old pentium III 450 mhz computer to consult
> my old C/C++ code.
>
> I really should transfer that stuff to my new Dream PC some day LOL.
>
> To avoid such nagging fools like this **** face in the previous post LOL.
>
> Bye,
> Skybuck.
>
> P.S.: I love the freedom of speech HAHAHA.
>



 
Reply With Quote
 
Richard Heathfield
Guest
Posts: n/a
 
      11-24-2006
Skybuck Flying said:

> This code nicely demonstrates the different access times for RAM chips
> depending on index order/memory layout <- which is much more clear in my
> equally competent delphi code.


No, the code demonstrates something all right, but it isn't what you
imagine. And you claim your Delphi code is "equally competent"? I don't
quite know what to say.

<snip>

> P.S.: I love the freedom of speech HAHAHA.


Freedom of speech isn't what you think it is, either.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
 
Reply With Quote
 
Skybuck Flying
Guest
Posts: n/a
 
      11-24-2006
Oh now that I do have a working C/C++ example it's interesting to mention
that the slowest code below is even 2.5+ times slower than the Delphi
equivalent.

Hahahahaha at Visual Studio .NET 2003 and all users... oh wait it was the
debug version...

Holyshit, the release version is even 3 times a slow as the delphi debug
equivalent... tut tut tut.

Aren't release version supposed to be FASTER instead of SLOWER LOL.

Needless to say I am so glad I dont program in C++ nor do I use Visual
Studio C++ on a regular bases.

I only use it mostly to compare against Delphi and to have a laugh at C++
and Studio =D

However writing C++ code does have a hi-tech feeling too it but it's not
high tech at all, it's fast, but it's cheap, lazy, nasty, not robust, it s
crap LOL.

It does matter if you use Linux or Knoppix or Windows it s both written in a
CRAP language and thats why it's CRAP LOL.

Fast CRAP, People like FAST CRAP until it CRASHES LOL.

Bye,
Skybuck.


 
Reply With Quote
 
Skybuck Flying
Guest
Posts: n/a
 
      11-24-2006

"Richard Heathfield" <> wrote in message
news:...
> Skybuck Flying said:
>
>> This code nicely demonstrates the different access times for RAM chips
>> depending on index order/memory layout <- which is much more clear in my
>> equally competent delphi code.

>
> No, the code demonstrates something all right, but it isn't what you
> imagine. And you claim your Delphi code is "equally competent"? I don't
> quite know what to say.


I suggest you start a new newsgroup:

alt.newsgroup.for.frustrated.c.and.c++.programmers .who.nag.a.lot

As a relaxed Delphi programmer I shall stay out of that newsgroup unless I
want to have a laugh

Bye,
Skybuck.


 
Reply With Quote
 
Richard Heathfield
Guest
Posts: n/a
 
      11-24-2006
Skybuck Flying said:

> Oh now that I do have a working C/C++ example it's interesting to mention
> that the slowest code below is even 2.5+ times slower than the Delphi
> equivalent.


So write it properly, then.

> Hahahahaha at Visual Studio .NET 2003 and all users... oh wait it was the
> debug version...
>
> Holyshit, the release version is even 3 times a slow as the delphi debug
> equivalent... tut tut tut.
>
> Aren't release version supposed to be FASTER instead of SLOWER LOL.


Not necessarily, when written incompetently.

> Needless to say I am so glad I dont program in C++ nor do I use Visual
> Studio C++ on a regular bases.


It shows.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
 
Reply With Quote
 
Skybuck Flying
Guest
Posts: n/a
 
      11-24-2006
"Richard Heathfield" <> wrote in message
news:Yo-...
> Skybuck Flying said:
>
>> Oh now that I do have a working C/C++ example it's interesting to mention
>> that the slowest code below is even 2.5+ times slower than the Delphi
>> equivalent.

>
> So write it properly, then.


I did.

>> Hahahahaha at Visual Studio .NET 2003 and all users... oh wait it was the
>> debug version...
>>
>> Holyshit, the release version is even 3 times a slow as the delphi debug
>> equivalent... tut tut tut.
>>
>> Aren't release version supposed to be FASTER instead of SLOWER LOL.

>
> Not necessarily, when written incompetently.


Oh, can you write a better example ? I think not.

You simply have a big mouth and have absolutely no clue how to write multi
dimensional code in any language

>
>> Needless to say I am so glad I dont program in C++ nor do I use Visual
>> Studio C++ on a regular bases.

>
> It shows.


You have shown nothing but insults, big mouths, bad mouths and absolutety
nothing but stinking air.

To an objective reader of this thread it's clear who's the real troll...

It's you
Mister.I.Don't.Know.Jack.Squat.About.Writing.Multi .Dimensional.C.or.C++.Code.Thus.I.Can't.Post.Any.C ode.Even.If.I.Wanted.Too.Thus.Therefore.I.Post.Hot .Stinking.Air.And.Bow.To.Might.Skybuck.Proven.Code .

LOL

Bye,
Skybuck.


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
To convert a one dimensional array into a two dimensional array using C amrutha0303 Software 0 08-03-2010 10:02 PM
multi-dimensional arrays to 2-dimensional arrays Wirianto Djunaidi Ruby 2 04-29-2008 07:31 AM
multi dimensional array example Skybuck Flying C Programming 44 11-30-2006 05:24 AM
Multi-dimensional Array in Java? kk_oop Java 1 07-24-2004 11:23 PM
How do copy Strings from a single dimensional array to double dimensional array Venkat C++ 4 12-05-2003 09:23 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57