🔒 Locked
array
Advertisement
Original Post
look into std::vector
i personaly like making my own class for it as a dynamically allocated array. I like doing this as I can make it run just as fast as Vectors if not faster, designed specifically for my needs. Also it will have ALOT less overhead.
If you want a very simple sample sent to you via email or msn or whatever just give me a hollar at my unfinished website or email me.
If you want a very simple sample sent to you via email or msn or whatever just give me a hollar at my unfinished website or email me.
Simple dynamic array
int *anysize;
int entersize;
printf("Size: ");
scanf("%i",&entersize);
anysize=new int[entersize];
anysize[(entersize/2)]=8888;
delete [] anysize;
anysize=0;
For unlimited sized data structures you can either use linked lists or Vector class.
[edited by - MOVSW on March 10, 2003 12:27:55 AM]
int *anysize;
int entersize;
printf("Size: ");
scanf("%i",&entersize);
anysize=new int[entersize];
anysize[(entersize/2)]=8888;
delete [] anysize;
anysize=0;
For unlimited sized data structures you can either use linked lists or Vector class.
[edited by - MOVSW on March 10, 2003 12:27:55 AM]
quote:
Original post by TalonSnow
i personaly like making my own class for it as a dynamically allocated array. I like doing this as I can make it run just as fast as Vectors if not faster, designed specifically for my needs. Also it will have ALOT less overhead.
What overhead are you talking about with std::vector? How did you make it faster? Do you have the code and timing rig available?
I think maybe you haven''t tested properly.
will enum''s are constants. They will not help you.
I beleive that you are looking for struct.
Data *Data(int Size){
Data *dt = new Data[Size];
return dt;
}
As for the OS buddy good luck. Not that bad if you know ASM and Get all of the docs from vendors for hardware support. not easy to remember how to draw to a screen.
dx mov,1,eax; #gets badd at this point.
Not sure if that is valid syntax but from what I remember of ASM.
Got to remember all those damned meaningless registers... Not to forget the interupts and IRQ''s....... You would have to write from scratch all the low level drawing to a screen. Keyboard and mouse support? if you are that interested in an OS go download linux.
I beleive that you are looking for struct.
Data *Data(int Size){
Data *dt = new Data[Size];
return dt;
}
As for the OS buddy good luck. Not that bad if you know ASM and Get all of the docs from vendors for hardware support. not easy to remember how to draw to a screen.
dx mov,1,eax; #gets badd at this point.
Not sure if that is valid syntax but from what I remember of ASM.
Got to remember all those damned meaningless registers... Not to forget the interupts and IRQ''s....... You would have to write from scratch all the low level drawing to a screen. Keyboard and mouse support? if you are that interested in an OS go download linux.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement