dev-cpp-users Mailing List for Dev-C++ (Page 344)
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: Satish M. <sat...@ya...> - 2003-07-21 17:36:11
|
Hello Marc, Thank you for your reply. There is no real necessity for me to do so.. I can make it work using a hash table or some kind of a mapping function.. I just thought that if it was possible in the way I earlier asked, I could save some execution time as there will not be much need for searching operation.. As i got almost every feedback saying that this is not possible, I think I will stick to a hash table solution. Thank you for all your help with this. -Sateesh Medepalli --- Marc Heiligers <ma...@e-...> wrote: > I can see absolutely no requirement to do this at all. In addition (and > to > answer the question) I can see absolutely no way of doing it either. > Scripting languages that have some kind of eval statement could do this, > but > again, I can see no requirement for it (although I have used a similar > mechanism in a JScript ASP project to create objects of a particular > name, > but never dependant on data within the object itself). > > Maybe if you enlighten us on why you would want to do this, we could > help > you find a solution. > > __________________________________ > Marc Heiligers > > > > -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf Of Satish > Medepalli > Sent: 21 July 2003 06:28 > To: dev...@li... > Subject: [Dev-C++] Help with creating objects dynamically > > Hello, > > I have the following requirement while creating objects.. I will try > to > explain it using a small example.. > > Suppose I have a class Student defined and I want to create objects > of > type Student inside the main function.. > > And say, the actual name with which i want to create the obect is > stored in a character array at run time.. say i have the following > statement > char NAME[]=getName(); > and the above function is returning the name "JOHN" at run time. > > Now i want to get the name out of the character array and create the > object using that particular name at run time.. i.e., > Student JOHN; > > in a nutshell i want to give the name of the objects to be created at > run time. IS THIS POSSIBLE?? IF SO CAN ANYONE HELP ME WITH THIS?? > > Thank You in advance. > -Sateesh Medepalli > > __________________________________ > Do you Yahoo!? > SBC Yahoo! DSL - Now only $29.95 per month! > http://sbc.yahoo.com > > __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com |
|
From: Abhijit S. <mu...@gm...> - 2003-07-21 17:34:03
|
Hello, everyone. I have written a small utility called dev_star that allows Dev-C++ to use any C/C++ compiler. It does this by mapping the command-line and capturing the stdout/stderr of the target compiler. It then sends the captured data to a plug-in, which formats it so that Dev-C++ can parse it. I myself use only MinGW32, but I think this tool can be useful. I need people to write maps and plug-ins for compilers, and also to actually _test_ the thing out. If any of you have the time, visit the page: http://mudeth.tripod.com/dev_star.html Please report any suggestions, bug-fixes, etc. to me. TIA for your time. The program itself was inspired by a similar one by Luigi Santillo, called dev_bor, which was specific to Borland's free package. Related to that, I'd also like to ask the list why stream.getline(foo) doesn't seem to work when foo is a string. Is there another way to do this? -- Abhijit Shylanath Homepage: http://mudeth.tripod.com/ |
|
From: Marc H. <ma...@e-...> - 2003-07-21 17:23:25
|
I can see absolutely no requirement to do this at all. In addition (and = to answer the question) I can see absolutely no way of doing it either. Scripting languages that have some kind of eval statement could do this, = but again, I can see no requirement for it (although I have used a similar mechanism in a JScript ASP project to create objects of a particular = name, but never dependant on data within the object itself).=20 Maybe if you enlighten us on why you would want to do this, we could = help you find a solution. __________________________________ Marc Heiligers =20 -----Original Message----- From: dev...@li... [mailto:dev...@li...] On Behalf Of Satish Medepalli Sent: 21 July 2003 06:28 To: dev...@li... Subject: [Dev-C++] Help with creating objects dynamically Hello, I have the following requirement while creating objects.. I will try = to explain it using a small example.. Suppose I have a class Student defined and I want to create objects = of type Student inside the main function.. And say, the actual name with which i want to create the obect is stored in a character array at run time.. say i have the following statement char NAME[]=3DgetName(); and the above function is returning the name "JOHN" at run time. Now i want to get the name out of the character array and create the object using that particular name at run time.. i.e.,=20 Student JOHN; =20 in a nutshell i want to give the name of the objects to be created at run time. IS THIS POSSIBLE?? IF SO CAN ANYONE HELP ME WITH THIS?? Thank You in advance. -Sateesh Medepalli=20 __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com |
|
From: Michal M. <mol...@se...> - 2003-07-21 17:02:23
|
but curses are text-mode not graphics Frank Wagner wrote: > Hi, > > ncurses might be the library you are looking for. > > Greetings > > Frank > > >>>>"Esteban Valverde" <est...@ho...> 07/20 9:51 >>> > > Hi, anybody knows if there is any console graphics library for (DOS mode) > just like the old BGI mode from Borland ? > > thanks, Esteban |
|
From: xRxIxPx <xr...@gm...> - 2003-07-21 16:39:42
|
At 16:36 2003-07-21 +0530, Somanathan Kaimal wrote:
>This is a strange requirement. Name of the object is normally irrelevant=20
>compared to its definition. Do you mind in sharing your requirement?
>
>
>-----Original Message-----
>From: OROSZI Bal=E1zs [mailto:or...@vp...]
>Sent: Monday, July 21, 2003 4:26 PM
>To: dev...@li...
>Subject: Re: [Dev-C++] Help with creating objects dynamically
>
>Satish Medepalli wrote:
> > I have the following requirement while creating objects.. I will try=
to
> > explain it using a small example..
> >
> > Suppose I have a class Student defined and I want to create objects=
of
> > type Student inside the main function..
> >
> > And say, the actual name with which i want to create the obect is
> > stored in a character array at run time.. say i have the following
> > statement
> > char NAME[]=3DgetName();
> > and the above function is returning the name "JOHN" at run time.
> >
> > Now i want to get the name out of the character array and create the
> > object using that particular name at run time.. i.e.,
> > Student JOHN;
> >
> > in a nutshell i want to give the name of the objects to be created at
> > run time. IS THIS POSSIBLE?? IF SO CAN ANYONE HELP ME WITH THIS??
>
>Nope. As far as I know, this is not possible in C++. I know, that Perl
>can do it, but if you EVER programmed in Perl, you know how different it
>is. So I don't think it ca nbe done.
>
>A solution to your problem might be to give a "name" member to your
>class, then at object creation, the constructor takes it as parameter,
>and copies it into the name member.
Should work.
Well better: use a map. Something like this should work, though not tested=
=20
right now.
STL is a wonderful tool.;)
#include <map>
#include <string>
#include "MyObjectClass.h"
//and then have you object database
std::map<std::string, MyObjectClass*> obj_db;
void add_to_db()
{
MyObjectClass* obj =3D new MyObjectClass;
obj_db.insert(std::map<std::string, MyObjectClass*>::value_type(=20
std::string(getName()), obj));
}
MyObjectClass& get_from_db(const std::string& name)
{
std::map<std::string, MyObjectClass*>::iterator it;
it =3D obj_db.find(name);
if (it =3D=3D map.end()) throw std::string("name not found int=
obj_db");
return *it;
}
|
|
From: Michal M. <mol...@se...> - 2003-07-21 15:35:29
|
or you can simply download WinBGI as a DevPak through vUpdate (it is there under the name CLGDI) Yeoh HS wrote: > ----- Original Message ----- > From: "Esteban Valverde" <est...@ho...> > To: "dev-cpp" <dev...@li...> > Sent: Monday, July 21, 2003 3:51 AM > Subject: [Dev-C++] Graphics Library > > >>Hi, anybody knows if there is any console graphics library for (DOS mode) >>just like the old BGI mode from Borland ? >> >>thanks, Esteban >> >>------------------------------------------------- >>Esteban Valverde >>est...@ho... > > > Yes, there is port of Borland's BGI to Windows. I've downloaded WinBGI > sometime ago. > Unfortunately, the WinBGI package does not contain the .a file for use with > Dev-C++/MinGW. > > But I've tweaked the WinBGI source codes a bit and managed to build > libwinbgi.a. > Also, the original source for bgidemo.c from Borland is also included in the > package. > > I've created two Dev-C++ projects: > 1. To build libwinbgi.a from the source. > 2. To build testwinbgi.exe from bgidemo.cpp (I've re-named bgidemo.c to > bgidemo.cpp) > > I've zipped and uploaded Dev-C++/MinGW port of WinBGI in this file: > http://www.yeohhs.com/shareware/winbgi_DevCpp.zip (file size: 42.5KB) > > Please note that there were several warnings during the builds of both > libwinbgi and bgidemo.cpp. > However, the test program does work. > Also, I've not tested WinBGI thoroughly. :-) > > You can download WinBGI from here: > http://www.garret.ru/~knizhnik/lang.html > > I hope this helps. > > Best Regards, > Yeoh > -- |
|
From: Daniel K. O. <dan...@ya...> - 2003-07-21 14:44:22
|
Try to use the SDL version of the code. Azmi Bin Mohamed Ridwan wrote: > Hi there, > > I've been trying NeHe's Opengl tutorials (nehe.gamedev.net) on Windows > XP Home & Dev-cpp. When I reached tutorial 6, with the glaux function that > loads a BMP file, it compiles properly but does not run because glaux.dll > is not present. I tried putting the dll myself(from the opengl1.1 release > for win95) into the windows directory but it still does not run (some dll error). > > I've read that the glaux libraries are outdated. Can anyone suggest a > solution (either how to make it run or an alternative function to use)? > > > Thanks, > Azmi |
|
From: Scott S. S. <age...@co...> - 2003-07-21 12:16:59
|
This morning, a guy sent in tutorials that fix the Dev-C++ errors with the tutorials. one of them is Lesson 6. ~~Scott Simontis~~ Programmer |
|
From: Somanathan K. <som...@wi...> - 2003-07-21 11:45:35
|
Ioannis, why you said an errata in 'void somefunc(const button *btn)' ? -----Original Message----- From: Ioannis Vranos [mailto:iv...@em...]=20 Sent: Monday, July 21, 2003 4:16 PM To: dev...@li... Subject: RE: [Dev-C++] Virtual functions? Some errata: :-) > -----Original Message----- > From: Ioannis Vranos [mailto:iv...@em...]=20 > Sent: Monday, July 21, 2003 1:36 PM > To: 'dev...@li...' > Subject: RE: [Dev-C++] Virtual functions? >=20 >=20 > void somefunc(const button *btn) void somefunc(button *btn) Ioannis Vranos =20 * Programming pages: http://www.noicys.freeurl.com * Alternative URL 1: http://run.to/noicys * Alternative URL 2: http://www.noicys.cjb.net ------------------------------------------------------- This SF.net email is sponsored by: VM Ware With VMware you can run multiple operating systems on a single machine. WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the same time. Free trial click here: http://www.vmware.com/wl/offer/345/0 _______________________________________________ Dev-cpp-users mailing list Dev...@li... TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
|
From: Yeoh H. <ye...@ye...> - 2003-07-21 11:33:16
|
----- Original Message ----- From: "Frank Wagner" <F.W...@wi...> To: <est...@ho...>; <dev...@li...> Sent: Monday, July 21, 2003 2:21 PM Subject: Antw: [Dev-C++] Graphics Library Hi, ncurses might be the library you are looking for. Greetings Frank Is there a Windows port of ncurses? Best Regards, Yeoh -- |
|
From: Yeoh H. <ye...@ye...> - 2003-07-21 11:33:11
|
----- Original Message ----- From: "Esteban Valverde" <est...@ho...> To: "dev-cpp" <dev...@li...> Sent: Monday, July 21, 2003 3:51 AM Subject: [Dev-C++] Graphics Library > Hi, anybody knows if there is any console graphics library for (DOS mode) > just like the old BGI mode from Borland ? > > thanks, Esteban > > ------------------------------------------------- > Esteban Valverde > est...@ho... Yes, there is port of Borland's BGI to Windows. I've downloaded WinBGI sometime ago. Unfortunately, the WinBGI package does not contain the .a file for use with Dev-C++/MinGW. But I've tweaked the WinBGI source codes a bit and managed to build libwinbgi.a. Also, the original source for bgidemo.c from Borland is also included in the package. I've created two Dev-C++ projects: 1. To build libwinbgi.a from the source. 2. To build testwinbgi.exe from bgidemo.cpp (I've re-named bgidemo.c to bgidemo.cpp) I've zipped and uploaded Dev-C++/MinGW port of WinBGI in this file: http://www.yeohhs.com/shareware/winbgi_DevCpp.zip (file size: 42.5KB) Please note that there were several warnings during the builds of both libwinbgi and bgidemo.cpp. However, the test program does work. Also, I've not tested WinBGI thoroughly. :-) You can download WinBGI from here: http://www.garret.ru/~knizhnik/lang.html I hope this helps. Best Regards, Yeoh -- |
|
From: Ioannis V. <iv...@em...> - 2003-07-21 11:27:46
|
Some errata: :-) > -----Original Message----- > From: Ioannis Vranos [mailto:iv...@em...] > Sent: Monday, July 21, 2003 1:36 PM > To: 'dev...@li...' > Subject: RE: [Dev-C++] Virtual functions? > > > void somefunc(const button *btn) void somefunc(button *btn) Ioannis Vranos * Programming pages: http://www.noicys.freeurl.com * Alternative URL 1: http://run.to/noicys * Alternative URL 2: http://www.noicys.cjb.net |
|
From: Somanathan K. <som...@wi...> - 2003-07-21 11:26:49
|
I hope you are familiar with pointers. Its needs a good understanding of
pointers. See the below example,
Class base=20
{
public:
virtual void f1(){=20
...body ...
}
};
class derived1 : public base
{
public:
virtual void f1(){ // virtual or not doesn't matter here
...body...
}
}
class derived2 : public base
{
public:
virtual void f1(){
... body...
}
}
int main()
{
base* b;
derived1* d1 =3D new derived1;
derived2* d2 =3D new derived2;=20
b =3D d1;
b->f1(); //this calls the derived1 f1
b=3Dd2;
b->f1(); //this call the derived2 f1
// u should delete the objects....
} =20
this is a simple example, but in actual usage, it will be bit different
(Objects may be pooled in a list/array etc.). =20
-----Original Message-----
From: pr...@le... [mailto:pr...@le...]=20
Sent: Monday, July 21, 2003 3:34 PM
To: dev...@li...
Subject: [Dev-C++] Virtual functions?
Hi List,
I've been through numerous books & websites on this topic, but I _still_
can't quite understand what is the purpose of a virtual function.
From what I understand, a virtual function is defined in a base class,
but
isn't implemented there. The implementation goes in the derived class.
Now
if this is true, then why should I need to define a function in my base
class at all? Since I'm eventually going to implement it elsewhere, I
might
as well define it there too.
Am I even on the right track here? Can someone take me back to base
again?
Thanks.
Regards,
Pranav Negandhi
-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: Somanathan K. <som...@wi...> - 2003-07-21 11:07:18
|
This is a strange requirement. Name of the object is normally irrelevant = compared to its definition. Do you mind in sharing your requirement? -----Original Message----- From: OROSZI Bal=E1zs [mailto:or...@vp...]=20 Sent: Monday, July 21, 2003 4:26 PM To: dev...@li... Subject: Re: [Dev-C++] Help with creating objects dynamically Satish Medepalli wrote: > I have the following requirement while creating objects.. I will = try to > explain it using a small example.. >=20 > Suppose I have a class Student defined and I want to create objects = of > type Student inside the main function.. >=20 > And say, the actual name with which i want to create the obect is > stored in a character array at run time.. say i have the following > statement > char NAME[]=3DgetName(); > and the above function is returning the name "JOHN" at run time. >=20 > Now i want to get the name out of the character array and create = the > object using that particular name at run time.. i.e.,=20 > Student JOHN; =20 >=20 > in a nutshell i want to give the name of the objects to be created = at > run time. IS THIS POSSIBLE?? IF SO CAN ANYONE HELP ME WITH THIS?? Nope. As far as I know, this is not possible in C++. I know, that Perl=20 can do it, but if you EVER programmed in Perl, you know how different it = is. So I don't think it ca nbe done. A solution to your problem might be to give a "name" member to your=20 class, then at object creation, the constructor takes it as parameter,=20 and copies it into the name member. -- Greetings, Bal=E1zs ------------------------------------------------------- This SF.net email is sponsored by: VM Ware With VMware you can run multiple operating systems on a single machine. WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the same time. Free trial click here: http://www.vmware.com/wl/offer/345/0 _______________________________________________ Dev-cpp-users mailing list Dev...@li... TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
|
From: <or...@vp...> - 2003-07-21 10:55:42
|
Satish Medepalli wrote: > I have the following requirement while creating objects.. I will try to > explain it using a small example.. > > Suppose I have a class Student defined and I want to create objects of > type Student inside the main function.. > > And say, the actual name with which i want to create the obect is > stored in a character array at run time.. say i have the following > statement > char NAME[]=getName(); > and the above function is returning the name "JOHN" at run time. > > Now i want to get the name out of the character array and create the > object using that particular name at run time.. i.e., > Student JOHN; > > in a nutshell i want to give the name of the objects to be created at > run time. IS THIS POSSIBLE?? IF SO CAN ANYONE HELP ME WITH THIS?? Nope. As far as I know, this is not possible in C++. I know, that Perl can do it, but if you EVER programmed in Perl, you know how different it is. So I don't think it ca nbe done. A solution to your problem might be to give a "name" member to your class, then at object creation, the constructor takes it as parameter, and copies it into the name member. -- Greetings, Balázs |
|
From: Ioannis V. <iv...@em...> - 2003-07-21 10:36:23
|
> -----Original Message-----
> From: dev...@li...=20
> [mailto:dev...@li...] On Behalf=20
> Of pr...@le...
> Sent: Monday, July 21, 2003 1:04 PM
> To: dev...@li...
> Subject: [Dev-C++] Virtual functions?
>=20
>=20
> Hi List,
>=20
> I've been through numerous books & websites on this topic,=20
> but I _still_
> can't quite understand what is the purpose of a virtual function.
Polymorphism.
=20
> From what I understand, a virtual function is defined in a=20
> base class, but
> isn't implemented there.
No. A virtual function can be defined in the base class. If it is not
defined (=3D0 is used), this indicates that the class is abstract, that =
is no
object of it can be created.
Example:
class base_whatever
{
// ...
public:
virtual void something() const=3D0;
};
// Error
base_whatever x;
class button
{
// ...
=20
public:
// We could make it abstract which would suit better to this
// example
virtual void make_pushed();
};
class flash_button: public button
{
// ...
public:
void make_pushed();
};
class rectangular_button: public button
{
// ...
public:
void make_pushed();
};
void somefunc(const button *btn)
{
// ...
btn->make_pushed();
}
Depending on which object btn points to, the appropriate make_pushed()
member function is called. This is called polymorphishm.
In C++ the time cost of such a virtual function call is the same, =
regardless
of the depth of the inheritance.
Ioannis Vranos
=20
* Programming pages: http://www.noicys.freeurl.com
* Alternative URL 1: http://run.to/noicys
* Alternative URL 2: http://www.noicys.cjb.net
|
|
From: Jaap de W. <wo...@ne...> - 2003-07-21 10:17:55
|
You have access to functions without knowing of which class they are:
eg:
suppose you have a base class Person with virtual function: IsMale();
You have two derived classes: Man and Woman.
std::list<Person *> Employees;
You can add a man to your organisation by:
Employees.push_back(new Man(...));
or a woman
Employees.push_back(new Woman(...));
Now you can count the number of man in your organisation with
NrMan = 0;
for (i=Employees.begin(); i != Employees.end(); i++)
{
NrMan = (*i)->IsMale();
}
> -----Original Message-----
> From: pr...@le... [mailto:pr...@le...]
> Sent: Monday, July 21, 2003 12:04 PM
> To: dev...@li...
> Subject: [Dev-C++] Virtual functions?
>
>
> Hi List,
>
> I've been through numerous books & websites on this topic,
> but I _still_
> can't quite understand what is the purpose of a virtual function.
>
> From what I understand, a virtual function is defined in a
> base class, but
> isn't implemented there. The implementation goes in the
> derived class. Now
> if this is true, then why should I need to define a function
> in my base
> class at all? Since I'm eventually going to implement it
> elsewhere, I might
> as well define it there too.
>
> Am I even on the right track here? Can someone take me back
> to base again?
>
> Thanks.
>
> Regards,
> Pranav Negandhi
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: VM Ware
> With VMware you can run multiple operating systems on a
> single machine.
> WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual
> machines at the
> same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: Daniel G. <sp...@ho...> - 2003-07-21 09:59:36
|
Thanks, I expect the changes will take place once I restart. >From: Zodiaq <zo...@ac...> >Reply-To: Zodiaq <zo...@ac...> >To: Dev...@li... >Subject: Re: [Dev-C++] OT: Changing icons for .h and .cpp files - general >windows Q >Date: Mon, 21 Jul 2003 10:19:30 +0200 > >Hello Daniel and all Dev-C++ users, > >Monday, July 21, 2003, 9:30:29 AM, Daniel wrote as follows: > >DG> I've installed DEV onto my machine which also has visual studio. >DG> Unfortunately the icons changed to the ones for DEV for .h and .cpp >files >DG> etc. How can I change them back? I've right clicked and done Open With >and >DG> set to always use MSDEV with this sort of file, and I can double click >on >DG> the icons (they are regular FILE icons) to launch them in visual >studio, but >DG> I can't get the icons back! > >DG> Any ideas??? > >Yeah, quite a few... I want to learn Linux and OpenGL and I have a >good idea how to do it, and I know that it's a looooong way... >lots to do... for linux I recently downloaded lots of ebook, chosen >slack and will get to it in few weeks... about oGL I've chosen ogre, >but that also have to wait... > >But about your simple question: >menu start->control panel->folder option->file types->finc .cpp and .h >and click properites (or change) - the rest I think you'll do alone > > >-- >regards, Zodiaq > > > >------------------------------------------------------- >This SF.net email is sponsored by: VM Ware >With VMware you can run multiple operating systems on a single machine. >WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the >same time. Free trial click here: http://www.vmware.com/wl/offer/345/0 >_______________________________________________ >Dev-cpp-users mailing list >Dev...@li... >TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm >https://lists.sourceforge.net/lists/listinfo/dev-cpp-users _________________________________________________________________ Find a cheaper internet access deal - choose one to suit you. http://www.msn.co.uk/internetaccess |
|
From: <pr...@le...> - 2003-07-21 09:51:35
|
Hi List, I've been through numerous books & websites on this topic, but I _still_ can't quite understand what is the purpose of a virtual function. From what I understand, a virtual function is defined in a base class, but isn't implemented there. The implementation goes in the derived class. Now if this is true, then why should I need to define a function in my base class at all? Since I'm eventually going to implement it elsewhere, I might as well define it there too. Am I even on the right track here? Can someone take me back to base again? Thanks. Regards, Pranav Negandhi |
|
From: Zodiaq <zo...@ac...> - 2003-07-21 08:19:28
|
Hello Daniel and all Dev-C++ users, Monday, July 21, 2003, 9:30:29 AM, Daniel wrote as follows: DG> I've installed DEV onto my machine which also has visual studio. DG> Unfortunately the icons changed to the ones for DEV for .h and .cpp files DG> etc. How can I change them back? I've right clicked and done Open With and DG> set to always use MSDEV with this sort of file, and I can double click on DG> the icons (they are regular FILE icons) to launch them in visual studio, but DG> I can't get the icons back! DG> Any ideas??? Yeah, quite a few... I want to learn Linux and OpenGL and I have a good idea how to do it, and I know that it's a looooong way... lots to do... for linux I recently downloaded lots of ebook, chosen slack and will get to it in few weeks... about oGL I've chosen ogre, but that also have to wait... But about your simple question: menu start->control panel->folder option->file types->finc .cpp and .h and click properites (or change) - the rest I think you'll do alone -- regards, Zodiaq |
|
From: Daniel G. <sp...@ho...> - 2003-07-21 07:30:35
|
I've installed DEV onto my machine which also has visual studio. Unfortunately the icons changed to the ones for DEV for .h and .cpp files etc. How can I change them back? I've right clicked and done Open With and set to always use MSDEV with this sort of file, and I can double click on the icons (they are regular FILE icons) to launch them in visual studio, but I can't get the icons back! Any ideas??? _________________________________________________________________ It's fast, it's easy and it's free. Get MSN Messenger today! http://www.msn.co.uk/messenger |
|
From: Frank W. <F.W...@wi...> - 2003-07-21 06:22:28
|
Hi, ncurses might be the library you are looking for. Greetings Frank >>> "Esteban Valverde" <est...@ho...> 07/20 9:51 >>> Hi, anybody knows if there is any console graphics library for (DOS mode) just like the old BGI mode from Borland ? thanks, Esteban ------------------------------------------------- Esteban Valverde est...@ho...=20 ------------------------------------------------------- This SF.net email is sponsored by: VM Ware With VMware you can run multiple operating systems on a single machine. WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the same time. Free trial click here: http://www.vmware.com/wl/offer/345/0=20 _______________________________________________ Dev-cpp-users mailing list Dev...@li...=20 TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm=20 https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
|
From: Azmi B. M. R. <az...@bi...> - 2003-07-21 05:37:44
|
Hi there, I've been trying NeHe's Opengl tutorials (nehe.gamedev.net) on Windows XP Home & Dev-cpp. When I reached tutorial 6, with the glaux function that loads a BMP file, it compiles properly but does not run because glaux.dll is not present. I tried putting the dll myself(from the opengl1.1 release for win95) into the windows directory but it still does not run (some dll error). I've read that the glaux libraries are outdated. Can anyone suggest a solution (either how to make it run or an alternative function to use)? Thanks, Azmi |
|
From: Satish M. <sat...@ya...> - 2003-07-21 04:28:36
|
Hello, I have the following requirement while creating objects.. I will try to explain it using a small example.. Suppose I have a class Student defined and I want to create objects of type Student inside the main function.. And say, the actual name with which i want to create the obect is stored in a character array at run time.. say i have the following statement char NAME[]=getName(); and the above function is returning the name "JOHN" at run time. Now i want to get the name out of the character array and create the object using that particular name at run time.. i.e., Student JOHN; in a nutshell i want to give the name of the objects to be created at run time. IS THIS POSSIBLE?? IF SO CAN ANYONE HELP ME WITH THIS?? Thank You in advance. -Sateesh Medepalli __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com |
|
From: Satish M. <sat...@ya...> - 2003-07-21 04:02:19
|
__________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com |