dev-cpp-users Mailing List for Dev-C++ (Page 422)
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
You can subscribe to this list here.
| 2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(15) |
Oct
(115) |
Nov
(154) |
Dec
(258) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2001 |
Jan
(377) |
Feb
(260) |
Mar
(249) |
Apr
(188) |
May
(152) |
Jun
(150) |
Jul
(195) |
Aug
(202) |
Sep
(200) |
Oct
(286) |
Nov
(242) |
Dec
(165) |
| 2002 |
Jan
(245) |
Feb
(241) |
Mar
(239) |
Apr
(346) |
May
(406) |
Jun
(369) |
Jul
(418) |
Aug
(357) |
Sep
(362) |
Oct
(597) |
Nov
(455) |
Dec
(344) |
| 2003 |
Jan
(446) |
Feb
(397) |
Mar
(515) |
Apr
(524) |
May
(377) |
Jun
(387) |
Jul
(532) |
Aug
(364) |
Sep
(294) |
Oct
(352) |
Nov
(295) |
Dec
(327) |
| 2004 |
Jan
(416) |
Feb
(318) |
Mar
(324) |
Apr
(249) |
May
(259) |
Jun
(218) |
Jul
(212) |
Aug
(259) |
Sep
(158) |
Oct
(162) |
Nov
(214) |
Dec
(169) |
| 2005 |
Jan
(111) |
Feb
(165) |
Mar
(199) |
Apr
(147) |
May
(131) |
Jun
(163) |
Jul
(235) |
Aug
(136) |
Sep
(84) |
Oct
(88) |
Nov
(113) |
Dec
(100) |
| 2006 |
Jan
(85) |
Feb
(119) |
Mar
(33) |
Apr
(31) |
May
(56) |
Jun
(68) |
Jul
(18) |
Aug
(62) |
Sep
(33) |
Oct
(55) |
Nov
(19) |
Dec
(40) |
| 2007 |
Jan
(22) |
Feb
(49) |
Mar
(34) |
Apr
(51) |
May
(66) |
Jun
(43) |
Jul
(116) |
Aug
(57) |
Sep
(70) |
Oct
(69) |
Nov
(97) |
Dec
(86) |
| 2008 |
Jan
(32) |
Feb
(47) |
Mar
(106) |
Apr
(67) |
May
(28) |
Jun
(39) |
Jul
(31) |
Aug
(25) |
Sep
(18) |
Oct
(25) |
Nov
(5) |
Dec
(21) |
| 2009 |
Jan
(33) |
Feb
(27) |
Mar
(27) |
Apr
(22) |
May
(22) |
Jun
(10) |
Jul
(17) |
Aug
(9) |
Sep
(21) |
Oct
(13) |
Nov
(4) |
Dec
(11) |
| 2010 |
Jan
(10) |
Feb
(8) |
Mar
(4) |
Apr
(1) |
May
|
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(8) |
Oct
(26) |
Nov
(9) |
Dec
(1) |
| 2011 |
Jan
(21) |
Feb
(16) |
Mar
(4) |
Apr
(19) |
May
(26) |
Jun
(9) |
Jul
(6) |
Aug
|
Sep
(4) |
Oct
(3) |
Nov
(2) |
Dec
(1) |
| 2012 |
Jan
(4) |
Feb
(7) |
Mar
(4) |
Apr
|
May
(1) |
Jun
(10) |
Jul
(1) |
Aug
(1) |
Sep
(18) |
Oct
(3) |
Nov
(1) |
Dec
(1) |
| 2013 |
Jan
(4) |
Feb
(2) |
Mar
(15) |
Apr
(6) |
May
(1) |
Jun
(3) |
Jul
(1) |
Aug
(2) |
Sep
(4) |
Oct
|
Nov
(9) |
Dec
|
| 2014 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(5) |
Aug
(4) |
Sep
|
Oct
(2) |
Nov
(1) |
Dec
(4) |
| 2015 |
Jan
(2) |
Feb
(3) |
Mar
(1) |
Apr
(2) |
May
(1) |
Jun
(2) |
Jul
|
Aug
(1) |
Sep
(2) |
Oct
(9) |
Nov
(35) |
Dec
(6) |
| 2016 |
Jan
(7) |
Feb
(10) |
Mar
(10) |
Apr
(9) |
May
(13) |
Jun
(9) |
Jul
(1) |
Aug
(3) |
Sep
(3) |
Oct
(1) |
Nov
(1) |
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2018 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
(1) |
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2020 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Brian S. <blu...@at...> - 2003-03-12 01:23:59
|
While trying to implement your code, I noticed that it was very similar to
my own method that I was using. I was setting a flag called end_game to 0
and if the escape key was pressed it would change to 1, therefore ending the
game and shutting down. I implemented the new code anyways in hopes that it
would work, but got the same results as with mine. Heres what my code looks
like:
void do_game()
{
do {
doInterrupt=true;
drawtext(); //Displays amount of bullets remaining
player1(); //These functions look at all the possible input keys
player2();
}while(!key[KEY_ESC]);
}
My bullet function looks like this:
void upbullet() //For bottom ship, bullet moving up
{
if(bcb<=0) { //check the counter. If 0, do nothing
}
else { //otherwise do this
bcb--; //subtract one from the counter
bottomb.x = bottom.x3; //bottomb is the name of my bullet structure
//bottom.x3 is reffering to the
bottom ship.
bottomb.y = bottom.y3 - 12;
do {
bottomb.draw(screen); //Draw the bullet
rest(1); // rest so that you can see it moving
bottomb.undraw(screen); // Undraw it
bottomb.y-=2; //move it up the screen 2
}while (bottomb.y >=-15); //do it until off the screen
}
}
Now this works, but every time that you shoot, you can see the bullet moving
up, but are not able to do anything else (like move the ship or fire again),
because it is caught in the do-while loop for the bullet. How would I get
around this and let it shoot/do anything else while the bullet is still
moving upwords?
Thanks!
-Brian
----- Original Message -----
From: "Brian Savells" <blu...@at...>
To: <Dev...@li...>
Sent: Tuesday, March 11, 2003 6:45 PM
Subject: Re: [Dev-C++] Help with Game Problem
> Oh yes, forgot to mention that I am using the Allegro library. Ill try the
> method that you gave me and see if that gets me anywhere.
>
> -Brian
>
>
> ----- Original Message -----
> From: "Robson Bernard" <rob...@su...>
> To: "Brian Savells" <blu...@at...>
> Sent: Tuesday, March 11, 2003 6:43 PM
> Subject: Re: [Dev-C++] Help with Game Problem
>
>
> > Have you tried allegro game library (compatible with Dev-C++)? With
> allegro
> > you have some great stuff to make games. Try www.talula.demon.co.uk and
> > click the link to allegro library.
> >
> > Below a brief example of how to set interrupt handlers to manage game
> timing
> > with allegro and c++. It makes a very stable timing:
> >
> > Hope it helps!
> >
> >
> > // this boolean variable prevents from jumping for the next game step
> before
> > the time expected;
> > volatile bool doInterrupt;
> >
> >
> >
> > void refresh()
> > {
> > doInterrupt = false;
> > }
> > END_OF_FUNCTION(refresh)
> >
> >
> >
> > void doGame()
> > {
> > do {
> > doInterrupt = true; //sets another step
> >
> > //game stuff
> >
> > while(doInterrupt); //while doInterrup is true, the game
does
> > not advance for the next step.
> > //this interval is set by the
> > argument in the Install_Int funtion (in miliseconds).
> >
> > } while(!key[KEY_ESC]);
> >
> > }
> >
> >
> >
> > // this function sets an interrupt handler calling function 'refresh()'
> > every 50ms.
> > Install_int(refresh, 50);
> >
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by:Crypto Challenge is now open!
> Get cracking and register here for some mind boggling fun and
> the chance of winning an Apple iPod:
> http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0031en
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: Brian S. <blu...@at...> - 2003-03-12 00:47:18
|
Oh yes, forgot to mention that I am using the Allegro library. Ill try the method that you gave me and see if that gets me anywhere. -Brian ----- Original Message ----- From: "Robson Bernard" <rob...@su...> To: "Brian Savells" <blu...@at...> Sent: Tuesday, March 11, 2003 6:43 PM Subject: Re: [Dev-C++] Help with Game Problem > Have you tried allegro game library (compatible with Dev-C++)? With allegro > you have some great stuff to make games. Try www.talula.demon.co.uk and > click the link to allegro library. > > Below a brief example of how to set interrupt handlers to manage game timing > with allegro and c++. It makes a very stable timing: > > Hope it helps! > > > // this boolean variable prevents from jumping for the next game step before > the time expected; > volatile bool doInterrupt; > > > > void refresh() > { > doInterrupt = false; > } > END_OF_FUNCTION(refresh) > > > > void doGame() > { > do { > doInterrupt = true; //sets another step > > //game stuff > > while(doInterrupt); //while doInterrup is true, the game does > not advance for the next step. > //this interval is set by the > argument in the Install_Int funtion (in miliseconds). > > } while(!key[KEY_ESC]); > > } > > > > // this function sets an interrupt handler calling function 'refresh()' > every 50ms. > Install_int(refresh, 50); > |
|
From: Robson B. <rob...@su...> - 2003-03-12 00:43:29
|
Have you tried allegro game library (compatible with Dev-C++)? With allegro you have some great stuff to make games. Try www.talula.demon.co.uk and click the link to allegro library. Below a brief example of how to set interrupt handlers to manage game timing with allegro and c++. It makes a very stable timing: Hope it helps! // this boolean variable prevents from jumping for the next game step before the time expected; volatile bool doInterrupt; void refresh() { doInterrupt = false; } END_OF_FUNCTION(refresh) void doGame() { do { doInterrupt = true; //sets another step //game stuff while(doInterrupt); //while doInterrup is true, the game does not advance for the next step. //this interval is set by the argument in the Install_Int funtion (in miliseconds). } while(!key[KEY_ESC]); } // this function sets an interrupt handler calling function 'refresh()' every 50ms. Install_int(refresh, 50); |
|
From: Brian S. <blu...@at...> - 2003-03-12 00:16:21
|
Hello, I'm programming my first game and need a little help. Well I'm making a = simple (well it was supposed to be simple lol) two player shooter game. = Each player uses a series of keys on the keyboard to move/fire the ship. = Well my first problem (that I was able to solve on my own - go me!) was = that the ships were slowing each other down when they were both moving = at the same time. I fixed this by placing a rest() function at the end = of each getInput functions instead of at each key input. (I have two = getInput()'s - One for each player) My problem now is, I'm wondering how = to incorporate the shoot functions. I have two functions (One that = shoots up, and another that shoots down) to handle the shooting. They = are simple and only involve drawing a circle that increases or decreases = its y-axis. If I place a rest() or vsync() every time it redraws, it = hinders either ship from moving (because it is caught in that loop). How = can I incorporate it so that the bullet can still be moving up and I = would still be able to maneuver the ship(s) and/or fire again? Any help = would be greatly appreciated! Thanks! -Brian |
|
From: <cg...@wo...> - 2003-03-11 18:39:41
|
Jaaaaaa!!!!!!
I achieved to do it right!!!!
The correct code, with comments, for those who could be interested in=20
the subject:
/*Veamos c=F3mo se ensambla esto*/
#.include "asm_io.S"
.data
mensaje4: .ascii "Introduzca un n=FAmero\n\0" # Template strings for
#=20
printf and scanf
mensaje5: .ascii "El doble es: \0"
string1: .ascii "%d\n\0"
string2: .ascii "%d\0"
string3: .ascii "%s\0" =20
string4: .ascii "%s\n\0"
string5: .ascii "%c\n\0"
numer: .long 1 #I've not achieved to use this variable yet
# I only can output it, but not input a value
# from stdin
.bss
.comm entero, 4 # Here I'll put an integer number from stdin
# using scanf, then I'll sum it by itself and=20
output
# the result
.comm string, 255 # A string, I'll input a phrase and output it
# and the second character from it.
.text
numer =3D 200 #I set numer to be =3D 200, without this line
# it is not =3D!, but to whatever value
#entero =3D 100 ##if I add this line, then I get an
## error when input.
.global _asm_main
.extern _printf
.extern scanf # I forgot the underscore, but it works
_asm_main:
enter $0, $0
pusha
movl $mensaje4, %eax
pushl %eax
call _printf
addl $4, %esp # I changed the number added to %esp
movl $entero, %ebx # I pass the variable
# If I pass numer here
# I have use the template
# "%l" for printf
pushl %ebx
movl $string2, %eax # "%d"
pushl %eax
call _scanf
addl $8, %esp
movl entero(,1), %eax # I pass the direction of entero
# With numer, I use $numer
# and it is accepted (with numer(,1)
# it generates an error and
# is closed by windows
# But its value is still 200, not the
# new input from stdin.
pushl %eax
movl $string1, %eax # "%d"
push %eax
call _printf
addl $8, %esp
movl entero(,1), %eax
addl %eax, %eax # sum it by itself
pushl %eax # And print the result
# But I don't store it
# back to the variable
movl $string1, %eax
pushl %eax
call _printf
addl $8, %esp
mov $string, %ebx # I pass the string variable
push %ebx
movl $string3, %eax
push %eax
call _scanf # And read from stdin
addl $8, %esp
movl $string, %eax
push %eax
movl $string4, %eax
push %eax
call _printf # I display the whole string
# If you use a string with whitespaces
# you'll see that, as C, it's printed only
# till the last char before the space
# And that's what where stored in the
# string variable from input
addl $8, %esp
movl $1, %ebx # I pass the index I want to %ebx
mov string(,%ebx,1), %ecx # I pass to %ecx the
# value which in C would
# be denoted by string[1]
push %ecx
movl $string5, %eax # "%c\n\0"
push %eax
call _printf # I print the second char of string
addl $8, %esp
popa
movl $0, %eax
leave
ret
Regarding the objection by Per Westernak (Thank you!) You were right,=20
it worked fine till I used the last paragraph of code, there I had added=20
so many to %esp it returned access violation, I changed the numbers,=20
assuming that the functions printf and scanf had done yet the removal of=20
the returning address and restored and popped out its %ebp (Which is the=20
correct, %ebp is restored an popped out explicitly by the callee and the=20
return address is popped implicitly by ret, just as it was implicitly=20
pushed with call. I forgot this).
|
|
From: Tulius L. <tul...@ho...> - 2003-03-11 15:55:15
|
Hello,
Does anyone know about any avaiable XML processing classes for C++?
[]s
Tulius
_________________________________________________________________
MSN Messenger: converse com os seus amigos online.
http://messenger.msn.com.br
|
|
From: Robson B. <rob...@su...> - 2003-03-11 14:08:25
|
Thanks Vranos, how could i forget the template definition??? That's why im knocking my head!! []'s |
|
From: Luigi S. <gi...@li...> - 2003-03-11 11:00:28
|
On Mon, Mar 10, 2003 at 03:26:56PM -0600, Samuel Keding wrote:
> I have trouble reading Ioannis Vranos's email
> [..]
Also, please consider wrapping mail at some 70 characters or so, it
would be of help when reading. For instance I've received the mail
I'm replying to, as a 139 words single line message (not considering,
of course, trailing stuff added by the list), in fact,
typing:
wc < message
yields:
1 139 688
thank you
--
>> gisan >>
|
|
From: Ioannis V. <iv...@in...> - 2003-03-11 04:11:49
|
-----------------------Original Message-----------------------
>From: Robson Bernard [mailto:rob...@su...]
>To: Ioannis Vranos [mailto:iv...@in...]; C++ Mail List
[mailto:dev...@li...]
>Date: 11/3/2003 5:56:00 =F0=EC
>Subject: Re: [Dev-C++] Scope in Template
>
>
>>>vector is optimized in space/time for regular use. Yours will be less
>>>flexible and less efficient.
>
>
>>>There are other containers too you know, including valarray.
>
>
>Maybe, Ioannis. But i'm projecting the ctable to take care specifically =
of
>my game project, since i will not use some of the vector features. the
>vector header file increases my finex (final exe) ;-) about 15kb and it=
is
>not desireable for a 150kb game. Maybe some people find it usefull when =
i
>finish it. If you have some sugestion about what to do or not to do in t=
he
>table classe you are welcome, since i am not too experienced with c++ an=
y
>input are welcome!
>
>Ah... my previous problems with that class continues...
>
>[]'s
valarray is an array container optimised for numerical computations. It i=
s
equivalent to Fortran's arrays. This means that it does not provide many
facilities so as to achieve that. I think valarray is what you are lookin=
g
for.
Why the problem is not fixed? As i told, you had forgotten one line of co=
de:
template<class T>
>void Table<T>::push(T& newObject)
>{
Ioannis Vranos=20
* Programming pages: http://www.noicys.freeurl.com
* Alternative URL: http://run.to/noicys=20
|
|
From: Robson B. <rob...@su...> - 2003-03-11 03:56:22
|
>>vector is optimized in space/time for regular use. Yours will be less >>flexible and less efficient. >>There are other containers too you know, including valarray. Maybe, Ioannis. But i'm projecting the ctable to take care specifically of my game project, since i will not use some of the vector features. the vector header file increases my finex (final exe) ;-) about 15kb and it is not desireable for a 150kb game. Maybe some people find it usefull when i finish it. If you have some sugestion about what to do or not to do in the table classe you are welcome, since i am not too experienced with c++ any input are welcome! Ah... my previous problems with that class continues... []'s |
|
From: Ioannis V. <iv...@in...> - 2003-03-11 03:56:16
|
-----------------------Original Message----------------------- >From: Dondolo Mpho [mailto:MDo...@OL...] >To: dev...@li... [mailto:dev...@li...] >Date: 10/3/2003 2:35:00 =EC=EC >Subject: [Dev-C++] Re: Good C++ books > >Hi all,=20 >Does anybody know of a good site where I can get a good beginner's C ++ book/tutorial.=20 Check the Tutorials section at this page of mine: http://www.noicys.cjb.net/links.htm Ioannis Vranos=20 * Programming pages: http://www.noicys.freeurl.com * Alternative URL: http://run.to/noicys=20 |
|
From: Ioannis V. <iv...@in...> - 2003-03-11 03:09:49
|
-----------------------Original Message-----------------------
>From: Robson Bernard [mailto:rob...@su...]
>To: C++ Mail List [mailto:dev...@li...]
>Date: 11/3/2003 3:03:00 =F0=EC
>Subject: [Dev-C++] Scope in Template
>
>Hello all c++ coders!
>
>I am working on a substitute for the vector template - <ctable> - due to
>some extra kbytes that <vector> increases in the exe file.=20
vector is optimized in space/time for regular use. Yours will be less
flexible and less efficient.
There are other containers too you know, including valarray.
> In the 'push'
>member function of my class template, named 'Table', i get the following
>error for line 20 when compiling:
>
> 20 'T' was not declared in this scope
> 20 template argument 1 is invalid
> 20 'T' was not declared in this scope
> 20 parse error before ')'
>
>Please HELP ME!!!
>
>the class:
>
>
>
>template <class T>
>class Table
>{
> T *ptrToArray;
> long tableSize;
>
> public:
> Table(int numberOfElements);
> Table(const Table & a);
> ~Table();
> T& operator=3D (const Table & a);
> T& operator[] (long index) {return ptrToArray[index];};
> long size() {return tableSize;};
> void erase(long index);
> void push(T& newObject);
>};
template<class T>
>void Table<T>::push(T& newObject)
>{
> T *temp =3D new T[tableSize + 1];
>
> for(long loopIndex =3D 0; loopIndex < tableSize; loopIndex++)
> temp[loopIndex] =3D ptrToArray[loopIndex];
>
> tableSize++;
>
> temp[tableSize - 1] =3D newObject;
>
> delete[] ptrToArray;
>
> T *ptrToArray =3D new T[tableSize];
>
> for(long loopIndex =3D 0; loopIndex < tableSize; loopIndex++)
> ptrToArray[loopIndex] =3D temp[loopIndex];
>
> delete[] temp;
>}
>
>
>
>template <class T>
>void Table<T>::erase(long index)
>{
> for(long loopIndex =3D index; loopIndex < tableSize - 1; loopIndex++=
)
> ptrToArray[loopIndex] =3D ptrToArray[loopIndex + 1];
>
> delete &ptrToArray[tableSize - 1];
> tableSize--;
>}
>
>
>
>template <class T>
>Table<T>::Table(int numberOfElements)
>{
> tableSize =3D numberOfElements;
> ptrToArray =3D new T[tableSize];
>}
>
>
>
>template <class T>
>Table<T>::Table(const Table & a)
>{
> tableSize =3D a.tableSize;
> T *ptrToArray =3D new T[tableSize];
>
> for(long loopIndex =3D 0; loopIndex < tableSize; loopIndex++)
> ptrToArray[loopIndex] =3D a.ptrToArray[loopIndex];
>}
>
>
>
>template <class T>
>T& Table<T>::operator=3D (const Table & a)
>{
> if(this =3D=3D &a) return *this;
> delete[] ptrToArray;
>
> tableSize =3D a.tableSize;
> T *ptrToArray =3D new T[tableSize];
>
> for(long loopIndex =3D 0; loopIndex < tableSize; loopIndex++)
> ptrToArray[loopIndex] =3D a.ptrToArray[loopIndex];
>
> return *this;
>}
>
>
>
>template <class T>
>Table<T>::~Table()
>{
> delete[] ptrToArray;
>}
Ioannis Vranos=20
* Programming pages: http://www.noicys.freeurl.com
* Alternative URL: http://run.to/noicys=20
|
|
From: Ioannis V. <iv...@in...> - 2003-03-11 03:03:33
|
-----------------------Original Message----------------------- >From: Samuel Keding [mailto:ib...@ly...] >To: dev...@li... [mailto:dev...@li...] >Date: 10/3/2003 11:49:00 =EC=EC >Subject: [Dev-C++] Re: Dev-cpp-users digest, Vol 1 #1335 - 8 msgs > >I have trouble reading Ioannis Vranos's email also but the reason that I have trouble is I'm in digest mode and the dev mailing list doesn't take out >the mime formatting which by the time it reaches my is viewed as pla= in text with all the =3D20 and so on in it. If I change my settings where ea= ch >individual email is sent directly to me, then it looks fine, but I get 5= 0 emails by the time the weekend is over. When I reply to someone the mail goes >directly to that person, not the mailing list so I have to remember to copy the mailing list into the cc or if I forget it is only sent to on= e individual. I >can be terribly bad about forgetting to copy the address s= o I use the digest mode.=20 After enough time of complaints i finally changed email client and placed the default to be text. It is a nice one, it even provides '>' to quote t= he previous message. :) Ioannis Vranos=20 * Programming pages: http://www.noicys.freeurl.com * Alternative URL: http://run.to/noicys=20 |
|
From: Ioannis V. <iv...@in...> - 2003-03-11 01:12:48
|
-----------------------Original Message----------------------- >From: Dondolo Mpho [mailto:MDo...@OL...] >To: dev...@li... [mailto:dev...@li...] >Date: 10/3/2003 2:35:00 =EC=EC >Subject: [Dev-C++] Re: Good C++ books > >Hi all,=20 >Does anybody know of a good site where I can get a good beginner's C ++ book/tutorial.=20 Check the Tutorials section at this page of mine: http://www.noicys.cjb.net/links.htm Ioannis Vranos=20 * Programming pages: http://www.noicys.freeurl.com * Alternative URL: http://run.to/noicys=20 |
|
From: Robson B. <rob...@su...> - 2003-03-11 00:39:42
|
Hello all c++ coders!
I am working on a substitute for the vector template - <ctable> - due to
some extra kbytes that <vector> increases in the exe file. In the 'push'
member function of my class template, named 'Table', i get the following
error for line 20 when compiling:
20 'T' was not declared in this scope
20 template argument 1 is invalid
20 'T' was not declared in this scope
20 parse error before ')'
Please HELP ME!!!
the class:
template <class T>
class Table
{
T *ptrToArray;
long tableSize;
public:
Table(int numberOfElements);
Table(const Table & a);
~Table();
T& operator= (const Table & a);
T& operator[] (long index) {return ptrToArray[index];};
long size() {return tableSize;};
void erase(long index);
void push(T& newObject);
};
void Table<T>::push(T& newObject)
{
T *temp = new T[tableSize + 1];
for(long loopIndex = 0; loopIndex < tableSize; loopIndex++)
temp[loopIndex] = ptrToArray[loopIndex];
tableSize++;
temp[tableSize - 1] = newObject;
delete[] ptrToArray;
T *ptrToArray = new T[tableSize];
for(long loopIndex = 0; loopIndex < tableSize; loopIndex++)
ptrToArray[loopIndex] = temp[loopIndex];
delete[] temp;
}
template <class T>
void Table<T>::erase(long index)
{
for(long loopIndex = index; loopIndex < tableSize - 1; loopIndex++)
ptrToArray[loopIndex] = ptrToArray[loopIndex + 1];
delete &ptrToArray[tableSize - 1];
tableSize--;
}
template <class T>
Table<T>::Table(int numberOfElements)
{
tableSize = numberOfElements;
ptrToArray = new T[tableSize];
}
template <class T>
Table<T>::Table(const Table & a)
{
tableSize = a.tableSize;
T *ptrToArray = new T[tableSize];
for(long loopIndex = 0; loopIndex < tableSize; loopIndex++)
ptrToArray[loopIndex] = a.ptrToArray[loopIndex];
}
template <class T>
T& Table<T>::operator= (const Table & a)
{
if(this == &a) return *this;
delete[] ptrToArray;
tableSize = a.tableSize;
T *ptrToArray = new T[tableSize];
for(long loopIndex = 0; loopIndex < tableSize; loopIndex++)
ptrToArray[loopIndex] = a.ptrToArray[loopIndex];
return *this;
}
template <class T>
Table<T>::~Table()
{
delete[] ptrToArray;
}
|
|
From: Samuel K. <ib...@ly...> - 2003-03-10 21:27:13
|
I have trouble reading Ioannis Vranos's email also but the reason that I have trouble is I'm in digest mode and the dev mailing list doesn't take out the mime formatting which by the time it reaches my is viewed as plain text with all the =20 and so on in it. If I change my settings where each individual email is sent directly to me, then it looks fine, but I get 50 emails by the time the weekend is over. When I reply to someone the mail goes directly to that person, not the mailing list so I have to remember to copy the mailing list into the cc or if I forget it is only sent to one individual. I can be terribly bad about forgetting to copy the address so I use the digest mode. _____________________________________________________________ Get 25MB, POP3, Spam Filtering with LYCOS MAIL PLUS for $19.95/year. http://login.mail.lycos.com/brandPage.shtml?pageId=plus&ref=lmtplus |
|
From: Colin L. <ha...@bl...> - 2003-03-10 19:35:03
|
Hello, > I have a 56Kbps modem connexion to the Net. > > While the vUpdate is a great package, it does NOT allow to resume broken > downloads. Since there are several users / countries where a DSL or Cable > connexion to the Net isn't available, I request the developers of vUpdate > to PLEASE incorporate an option to allow resumption of broken downloads. A new vUpdate is going to be written with support for resuming along with many other features. > Alternately, if the URLs at which the updates are available can be made > known by some other means, we could use a standard downloader viz., DAP or > FlashGet to do the job. You can still get latest versions from the CVS : http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/dev-cpp/V5/devcpp.exe Also, I will probably do a page on the Dev-C++ Resource Site to download updates soon. Greetings, Colin Laplace > Hope this will be addressed ASAP... > > > TIA, > Trevor ---------------------------------------- Content-Type: text/html; charset="iso-8859-1"; name="Attachment: 1" Content-Transfer-Encoding: quoted-printable Content-Description: ---------------------------------------- |
|
From: Cabeze de V. <dc...@ho...> - 2003-03-10 18:28:31
|
Hi, I've successfully compiled & linked my project, and now I want to strip the link file in order to generate the .bin file. Under Cygwin, I can give arm-elf-strip -O binary -o my_module.bin my_module.exe Is it possible to do that from within Dev-C++? Thank you. _________________________________________________________________ Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail |
|
From: nada <na...@ca...> - 2003-03-10 15:58:24
|
>>cout<<fixed;
>>
>>ANSI/ISO compliant?
>
>Isn=B4t that use an error? I=B4ve never seen it before. :/
This is a statement included in many college textbooks. It produces an=20
error with the gcc compiler.
I am asking if the statement is an ANSI/ISO compliant statement or not?
{rb}
|
|
From: JOSHI, M. G. R. M. <Mar...@rb...> - 2003-03-10 15:35:00
|
I like to work with read-only files (as a consequence of my source control
program). Devcpp won't let me add them to projects and if I make them read
only after
they get into the project, I get lots of message boxes asking me if I want
to make them writable.
Does any one know how to switch off this aversion to read-only files.
thanks
mark
********************************************************************
Visit our Internet site at http://www.rbsmarkets.com
This e-mail is intended only for the addressee named above.
As this e-mail may contain confidential or privileged information,
if you are not the named addressee, you are not authorised to
retain, read, copy or disseminate this message or any part of it.
The Royal Bank of Scotland plc is registered in Scotland No 90312
Registered Office: 36 St Andrew Square, Edinburgh EH2 2YB
Regulated by the Financial Services Authority
********************************************************************
|
|
From: <ri...@te...> - 2003-03-10 14:01:11
|
nada escribi=F3: > Is the use: > > cout<<fixed; > > ANSI/ISO compliant? Isn=B4t that use an error? I=B4ve never seen it before. :/ |
|
From: nada <na...@ca...> - 2003-03-10 13:08:25
|
>By the way, the "fixed undeclarer" error means that gcc treats "fixed" as=
=20
>a variable which wasn=B4t declared
Is the use:
cout<<fixed;
ANSI/ISO compliant?
{rb}
--
You cannot do a kindness too soon, for you never know how soon it will be=20
too late. - Ralph Waldo Emerson
|
|
From: Dondolo M. <MDo...@OL...> - 2003-03-10 12:07:25
|
Hi all, Does anybody know of a good site where I can get a good beginner's C ++ book/tutorial. Regards, Mpho |
|
From: Matt D. <md...@ua...> - 2003-03-10 07:01:23
|
Profile analysis seems to have a problem with project names containing spaces. For example, I have a project called "Iterative Merge", and when I attempt to use profile analysis, the profile analysis window is displayed but in the gray text area below the analysis chart it displays, "Iterative: No such file or directory," making me think this is an issue with project names containing spaces. Can anyone else verify this? |
|
From: <h.r...@gm...> - 2003-03-10 01:55:01
|
Hi, if i download fltk with vUpdate is it for gcc 3.2 or 2.9 ? This is a question for me since I have difficulties to download it from the resource site where the compiler version is shown. Thanks and greetings Horst -- +++ GMX - Mail, Messaging & more http://www.gmx.net +++ Bitte lächeln! Fotogalerie online mit GMX ohne eigene Homepage! |