dev-cpp-users Mailing List for Dev-C++ (Page 343)
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: <ten...@ne...> - 2003-07-22 18:48:33
|
Messages sent to this mailing list should be sent in text format, not html, so people who has mail program which don't read html have a hard work to find the text. (That's not my case, but so your trial is complete). Thank you. |
|
From: Abhijit S. <mu...@gm...> - 2003-07-22 18:28:40
|
> I was looking for some free library or program in C/C++ (or built > with the Allegro library) to plot sets of points in 3 dimensions?. If you're just looking to plot points, Allegro already has a lot of functions that you can use. This page may help you out: http://www.niksula.cs.hut.fi/~tparvine/allegro3d/ -- Abhijit Shylanath Homepage: http://mudeth.tripod.com/ |
|
From: Daniel G. <sp...@ho...> - 2003-07-22 17:48:23
|
Try www.gamedev.net >From: ri...@un... >To: Dev-Cpp-List <dev...@li...> >Subject: [Dev-C++] 3D_graphics >Date: Tue, 22 Jul 2003 14:40:39 +0200 > > > >I was looking for some free library or program in C/C++ (or built >with the Allegro library) to plot sets of points in 3 dimensions?. > >thanks in advance for your help or information. >Ricardo. > > >------------------------------------------------------- >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 _________________________________________________________________ Stay in touch with absent friends - get MSN Messenger http://www.msn.co.uk/messenger |
|
From: <ri...@un...> - 2003-07-22 12:41:53
|
I was looking for some free library or program in C/C++ (or built with the Allegro library) to plot sets of points in 3 dimensions?. thanks in advance for your help or information. Ricardo. |
|
From: Michal M. <mol...@se...> - 2003-07-22 12:13:25
|
Yeoh HS wrote: > And I've created Dev-C++ projects to test all the example programs. > All the example programs compile and run okay except for two programs. > There is a problem with the arrow keys. The testcurs and tuidemo programs > cannot recognize the left, right, up and down arrow keys. What could be > the cause of the arrow keys problem? Strange, but I'm not able to reproduce the problem here (I've tested it under WXP and W98), so I can't help with it. (BTW: some viruses or are sometimes blocking keyboard :-) but that's probably not the cause :-) ) > Also, to compile > tuidemo, tui.h is needed but it was not included in the DevPak. I've > downloaded the PDCurses zip from SourceForge to get the tui.h. thanks for pointing out. I've updated the DevPak accordingly. I've also created web page for my devpaks, it is available at: http://molhanec.net/devpaks.php (BTW I also put on my pages small archivers comparsion if anybody interested) |
|
From: Per W. <pw...@ia...> - 2003-07-22 11:37:46
|
No, there are no Class.forname.
But if you register all your classes into a map, you could create one
yourself:
#include <map>
#include <string>
class Base {
public:
virtual void Something() {}
};
typedef Base* (*PeopleFactory)();
class PeopleTypes {
protected:
std::map<std::string,PeopleFactory> factories;
public:
void Register(const char *type,Base* (*factory)());
Base* Allocate(const char *type);
};
extern PeopleTypes people_types;
class Student : public Base {
protected:
static Base* Factory() { return new Student; }
class RegisterStudent {
public:
RegisterStudent() {
people_types.Register("Student",Student::Factory);
}
}
static RegisterStudent register;
public:
...
};
Student::RegisterStudent Student::register; // Register "Student" factory
PeopleTypes people_types; // Keep map of factories
int main() {
Base *p = people_types.Allocate("Student");
p->Somethong();
delete p;
return 0;
}
/Per W
On Tue, 22 Jul 2003, Somanathan Kaimal wrote:
> Hi Marc,
>
> Thanks for the suggestion. The switch statement is the one I want to
> avoid in real time. As when the type of message (worker,clerk etc here)
> more and more switch statements needs to be added. If you know the
> working of Class.forname, you will get to know what I mean. One way I
> can achieve this is by pooling the object(this is how normally people
> does for real time saving) but would like to know there is an equivalent
> to Class.forname. I will rewrite your code if C++ has Class.forname
>
> #define PERSON_WORKER 1
> #define PERSON_CLERK 2
> #define PERSON_MANAGER 3
> base* NewPerson(int nType)
> {
> return(base*) Class.forname(person_types[i];// person_types has array
> of
> //strings, say "worker, clerk etc. Please note
> that //as and when the number
> of types
> //increased this line of code won't be
> //changed but only the array index needs
> //to be created
> }
>
> And then your function becomes:
>
> some_func(int i)
> {
> base *b = NewPerson(i);
> b->any_common_func();
> }
>
> Does it makes any sense?
>
> somanathan
>
> -----Original Message-----
> From: Marc Heiligers [mailto:ma...@e-...]
> Sent: Tuesday, July 22, 2003 1:42 PM
> To: Somanathan Kaimal; dev...@li...
> Subject: RE: [Dev-C++] Help with creating objects dynamically
>
> Hi Somanathan,
>
> There's probably a million different ways of doing this. I would
> probably
> start by creating a NewPerson method defined something like (and
> defines):
>
> #define PERSON_WORKER 1
> #define PERSON_CLERK 2
> #define PERSON_MANAGER 3
> base* NewPerson(int nType)
> {
> switch(nType)
> {
> case PERSON_WORKER:
> return (base*) new worker;
> case PERSON_CLERK:
> return (base*) new clerk;
> case PERSON_MANAGER:
> return (base*) new manager;
> default:
> return (base*) NULL;
> }
> }
>
> And then your function becomes:
>
> some_func(int i)
> {
> base *b = NewPerson(i);
> b->any_common_func();
> }
>
> Then you only have to maintain the switch in NewPerson().
> __________________________________
> Marc Heiligers
>
>
> -----Original Message-----
> From: Somanathan Kaimal [mailto:som...@wi...]
>
>
>
> Hi Gurus,
>
> I would like to take this discussion to another turn,
>
> Say if I have requirement like creating an object dynamically, means not
> the
> object name but the class definition needs to be dynamically chosen, for
> eg:- let me talk in C++ language
>
> Class worker : public base
> {
> }
> class clerk : public base
> {
> }
> class manager : public base
> {
> }
> // create an array of string
> string emp[3] = {"worker","clerk","manager"};
>
> some_func(int i)
> {
> base b* = new emp[i];
> b->any_common_func();
> }
>
> --------------
> This avoids lots of case statements, makes it easy to maintain and
> extend.
> Any body has any idea how to implement it in C++(equivalent to
> Class.forname
> in JAVA) If you have any other idea to accomplish this, also welcome.
>
> Let me know if things are not clear.
>
> Thanks
> Somanathan
>
>
>
>
> -------------------------------------------------------
> 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-22 10:49:45
|
Michal Molhanec wrote: > yes all my devpaks are for gcc 3.2 > please send me info if the DevPak works! > > Thanks in advance, > Michal > Thanks again. The pdcurses.DevPak installed okay. It is great. :-) And I've created Dev-C++ projects to test all the example programs. All the example programs compile and run okay except for two programs. There is a problem with the arrow keys. The testcurs and tuidemo programs cannot recognize the left, right, up and down arrow keys. Also, to compile tuidemo, tui.h is needed but it was not included in the DevPak. I've downloaded the PDCurses zip from SourceForge to get the tui.h. What could be the cause of the arrow keys problem? I'm using Dev-C++ 4.9.8.0 (GCC 3.2) and the example programs were compiled and run under Windows 98SE. Best Regards, Yeoh -- |
|
From: Somanathan K. <som...@wi...> - 2003-07-22 08:36:43
|
Hi Marc,
Thanks for the suggestion. The switch statement is the one I want to
avoid in real time. As when the type of message (worker,clerk etc here)
more and more switch statements needs to be added. If you know the
working of Class.forname, you will get to know what I mean. One way I
can achieve this is by pooling the object(this is how normally people
does for real time saving) but would like to know there is an equivalent
to Class.forname. I will rewrite your code if C++ has Class.forname
#define PERSON_WORKER 1
#define PERSON_CLERK 2
#define PERSON_MANAGER 3
base* NewPerson(int nType)
{
return(base*) Class.forname(person_types[i];// person_types has array
of =20
//strings, say "worker, clerk etc. Please note
that //as and when the number
of types
//increased this line of code won't be
//changed but only the array index needs
//to be created
}
And then your function becomes:
some_func(int i)
{
base *b =3D NewPerson(i);
b->any_common_func();
}
Does it makes any sense?
somanathan
-----Original Message-----
From: Marc Heiligers [mailto:ma...@e-...]=20
Sent: Tuesday, July 22, 2003 1:42 PM
To: Somanathan Kaimal; dev...@li...
Subject: RE: [Dev-C++] Help with creating objects dynamically
Hi Somanathan,
There's probably a million different ways of doing this. I would
probably
start by creating a NewPerson method defined something like (and
defines):
#define PERSON_WORKER 1
#define PERSON_CLERK 2
#define PERSON_MANAGER 3
base* NewPerson(int nType)
{
switch(nType)
{
case PERSON_WORKER:
return (base*) new worker;
case PERSON_CLERK:
return (base*) new clerk;
case PERSON_MANAGER:
return (base*) new manager;
default:
return (base*) NULL;
}
}
And then your function becomes:
some_func(int i)
{
base *b =3D NewPerson(i);
b->any_common_func();
}
Then you only have to maintain the switch in NewPerson().
__________________________________
Marc Heiligers
-----Original Message-----
From: Somanathan Kaimal [mailto:som...@wi...]=20
Hi Gurus,
I would like to take this discussion to another turn,
Say if I have requirement like creating an object dynamically, means not
the
object name but the class definition needs to be dynamically chosen, for
eg:- let me talk in C++ language=20
Class worker : public base
{
}
class clerk : public base
{
}
class manager : public base
{
}
// create an array of string
string emp[3] =3D {"worker","clerk","manager"};=20
some_func(int i)
{
base b* =3D new emp[i];
b->any_common_func();
}
--------------
This avoids lots of case statements, makes it easy to maintain and
extend.=20
Any body has any idea how to implement it in C++(equivalent to
Class.forname
in JAVA) If you have any other idea to accomplish this, also welcome.
Let me know if things are not clear.
Thanks
Somanathan
|
|
From: xRxIxPx <xr...@gm...> - 2003-07-22 08:30:50
|
At 18:40 2003-07-21 +0200, xRxIxPx wrote:
>At 16:36 2003-07-21 +0530, Somanathan Kaimal wrote:
>
>#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 = new MyObjectClass;
> obj_db.insert(std::map<std::string, MyObjectClass*>::value_type(
> std::string(getName()), obj));
>}
>
>MyObjectClass& get_from_db(const std::string& name)
>{
> std::map<std::string, MyObjectClass*>::iterator it;
> it = obj_db.find(name);
> if (it == map.end()) throw std::string("name not found int obj_db");
>
> return *it;
>}
D`oh. s/return *it/return **it/
And deletion:
void delete_from_db(const std::string& name)
{
std::map<std::string, MyObjectClass*>::iterator it;
it = obj_db.find(name);
if (it == map.end()) throw std::string("name not found int obj_db");
delete *it;
obj_db.erase(it);
}
|
|
From: Marc H. <ma...@e-...> - 2003-07-22 08:12:42
|
Hi Somanathan,
There's probably a million different ways of doing this. I would =
probably
start by creating a NewPerson method defined something like (and =
defines):
#define PERSON_WORKER 1
#define PERSON_CLERK 2
#define PERSON_MANAGER 3
base* NewPerson(int nType)
{
switch(nType)
{
case PERSON_WORKER:
return (base*) new worker;
case PERSON_CLERK:
return (base*) new clerk;
case PERSON_MANAGER:
return (base*) new manager;
default:
return (base*) NULL;
}
}
And then your function becomes:
some_func(int i)
{
base *b =3D NewPerson(i);
b->any_common_func();
}
Then you only have to maintain the switch in NewPerson().
__________________________________
Marc Heiligers
-----Original Message-----
From: Somanathan Kaimal [mailto:som...@wi...]=20
Hi Gurus,
I would like to take this discussion to another turn,
Say if I have requirement like creating an object dynamically, means not =
the
object name but the class definition needs to be dynamically chosen, for
eg:- let me talk in C++ language=20
Class worker : public base
{
}
class clerk : public base
{
}
class manager : public base
{
}
// create an array of string
string emp[3] =3D {"worker","clerk","manager"};=20
some_func(int i)
{
base b* =3D new emp[i];
b->any_common_func();
}
--------------
This avoids lots of case statements, makes it easy to maintain and =
extend.=20
Any body has any idea how to implement it in C++(equivalent to =
Class.forname
in JAVA) If you have any other idea to accomplish this, also welcome.
Let me know if things are not clear.
Thanks
Somanathan
|
|
From: Michal M. <mol...@se...> - 2003-07-22 08:10:11
|
Yeoh HS wrote: > Thanks very much for this info. At this very moment, I'm downloading the > pdcurses.DevPak. > Is the pdcurses.DevPak built for GCC 3.2? I'm using Dev-C++ 4.9.8.0 (GCC > 3.2). yes all my devpaks are for gcc 3.2 please send me info if the DevPak works! Thanks in advance, Michal |
|
From: Jaap de W. <wo...@ne...> - 2003-07-22 07:10:57
|
Below is a piece of code what is creating named objects dynamicaly.
Is that what you mean?
> -----Original Message-----
> From: Satish Medepalli [mailto:sat...@ya...]
> Sent: Monday, July 21, 2003 6:28 AM
> 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
>
=================================== start of code
===================================
#include <list>
#include <string>
#include <iostream>
class Object
{
public:
std::string &GetName(){return m_name;}
virtual std::string &GetFunction()=0;
protected:
Object(const char *name):m_name(name){}
Object(const Object &src):m_name(src.m_name){}
private:
std::string m_name;
friend std::ostream &operator <<(std::ostream &os, Object& ol);
};
class Student: public Object {
public:
virtual std::string &GetFunction(){return m_function;}
Student(const char *name):Object(name) {}
Student(const Student& src):Object(src) {}
private:
static std::string m_function;
};
class Teacher: public Object {
public:
virtual std::string &GetFunction(){return m_function;}
Teacher(const char *name):Object(name) {}
Teacher(const Teacher& src):Object(src) {}
private:
static std::string m_function;
};
std::string Student::m_function ("Student");
std::string Teacher::m_function ("Teacher");
class ObjectList: public std::list<Object *>
{
public:
~ObjectList();
};
ObjectList::~ObjectList()
{
iterator i;
for (i = begin(); i != end(); i++)
{
delete *i;
}
}
std::ostream &operator <<(std::ostream &os, Object& ob)
{
return os << ob.m_name << " (" << ob.GetFunction() << ")";
}
std::ostream &operator <<(std::ostream &os, ObjectList& ol)
{
ObjectList::iterator i;
for (i = ol.begin(); i != ol.end(); i++)
{
os << **i << std::endl;
}
return os;
}
void main()
{
ObjectList AllPeople;
AllPeople.push_back(new Student("Jan"));
AllPeople.push_back(new Student("Piet"));
AllPeople.push_back(new Student("Klaas"));
AllPeople.push_back(new Teacher("Jan"));
AllPeople.push_back(new Teacher("Mark"));
std::cout << AllPeople;
}
|
|
From: Vlada D. <dj...@im...> - 2003-07-22 06:51:39
|
Hi, list. I'm currently reding a book on game programing, and there is a bitmap manipulation class using TransparentBlt() function. The book says that, in order to use this function, you should link library msimg32.lib. he compiler used in the book is MS VC6. I added the commmand -lmsimg32 in linker options, but I can't compile the project. Is there msimg32 library in DevCpp? ------------ Vlada |
|
From: Somanathan K. <som...@wi...> - 2003-07-22 05:41:42
|
Hi Gurus,
I would like to take this discussion to another turn,
Say if I have requirement like creating an object dynamically, means not
the object name but the class definition needs to be dynamically chosen,
for eg:- let me talk in C++ language=20
Class worker : public base
{
}
class clerk : public base
{
}
class manager : public base
{
}
// create an array of string
string emp[3] =3D {"worker","clerk","manager"};=20
some_func(int i)
{
base b* =3D new emp[i];
b->any_common_func();
}
--------------
This avoids lots of case statements, makes it easy to maintain and
extend.=20
Any body has any idea how to implement it in C++(equivalent to
Class.forname in JAVA)
If you have any other idea to accomplish this, also welcome.
Let me know if things are not clear.
Thanks
Somanathan
-----Original Message-----
From: Marc Heiligers [mailto:ma...@e-...]=20
Sent: Tuesday, July 22, 2003 9:49 AM
To: 'Satish Medepalli'; dev...@li...
Subject: RE: [Dev-C++] Help with creating objects dynamically
Hi Sateesh,
I think what you're looking for is the STL std::map which serves as a
kind
of associative array. There are other guys on this list more educated in
the
ways of STL than I. I'm sure they will help you out if you have
problems.=20
__________________________________
Marc Heiligers
-----Original Message-----
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=20
> (and to answer the question) I can see absolutely no way of doing it=20
> either. Scripting languages that have some kind of eval statement=20
> 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
>=20
> Maybe if you enlighten us on why you would want to do this, we could=20
> help you find a solution.
>=20
> __________________________________
> Marc Heiligers
>=20
> -----Original Message-----
>=20
> I have the following requirement while creating objects.. I will=20
> 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=20
> stored in a character array at run time.. say i have the following=20
> 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=20
> the object using that particular name at run time.. i.e., Student=20
> JOHN;
>=20
> in a nutshell i want to give the name of the objects to be created=20
> at run time. IS THIS POSSIBLE?? IF SO CAN ANYONE HELP ME WITH THIS??
>=20
> Thank You in advance.
> -Sateesh Medepalli
-------------------------------------------------------
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: Marc H. <ma...@e-...> - 2003-07-22 04:35:58
|
Hi Sateesh, I think what you're looking for is the STL std::map which serves as a = kind of associative array. There are other guys on this list more educated in = the ways of STL than I. I'm sure they will help you out if you have = problems.=20 __________________________________ Marc Heiligers -----Original Message----- 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=20 > (and to answer the question) I can see absolutely no way of doing it=20 > either. Scripting languages that have some kind of eval statement=20 > 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 >=20 > Maybe if you enlighten us on why you would want to do this, we could=20 > help you find a solution. >=20 > __________________________________ > Marc Heiligers >=20 > -----Original Message----- >=20 > I have the following requirement while creating objects.. I will=20 > 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=20 > stored in a character array at run time.. say i have the following=20 > 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=20 > the object using that particular name at run time.. i.e., Student=20 > JOHN; >=20 > in a nutshell i want to give the name of the objects to be created=20 > at run time. IS THIS POSSIBLE?? IF SO CAN ANYONE HELP ME WITH THIS?? >=20 > Thank You in advance. > -Sateesh Medepalli |
|
From: Yeoh H. <ye...@ye...> - 2003-07-22 02:01:05
|
----- Original Message ----- From: "Michal Molhanec" <mol...@se...> To: <dev...@li...> Sent: Tuesday, July 22, 2003 2:39 AM Subject: Re: [Dev-C++] Graphics Library > _n_curses maybe as a part of cygwin > > but curses for windows are generally available as a part of the > PDCurses: http://pdcurses.sourceforge.net/ > > (or you can try my DevPak: http://molhanec.net/pdcurses.DevPak ) > Hi Michal, Thanks very much for this info. At this very moment, I'm downloading the pdcurses.DevPak. Is the pdcurses.DevPak built for GCC 3.2? I'm using Dev-C++ 4.9.8.0 (GCC 3.2). Best Regards, Yeoh -- Free downloads for Dev-C++ Users at http://www.yeohhs.com |
|
From: dein_metzger <dei...@ya...> - 2003-07-21 22:52:42
|
What=B4s the default true type font for the IDE of dev-cpp? thanks anyway --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.501 / Virus Database: 299 - Release Date: 14/7/2003 =20 |
|
From: Per W. <pw...@ia...> - 2003-07-21 22:37:26
|
Seems to work find - nice indentation of my original mail :-) /Per W On Mon, 21 Jul 2003, Graham Douglas wrote: > Is this any better? I've tried setting the preferences for this mailing > list to "plain text" so that it doesn't try to send HTML - let's see if > it works. I might have to try a couple of times to get the formatting > right, though. > > Sorry for the confusion - I'll get there in the end. > > Graham |
|
From: Graham D. <g.d...@nt...> - 2003-07-21 21:58:14
|
Is this any better? I've tried setting the preferences for this mailing list to "plain text" so that it doesn't try to send HTML - let's see if it works. I might have to try a couple of times to get the formatting right, though. Sorry for the confusion - I'll get there in the end. Graham Per Westermark wrote: >Hi Graham! > >Is there possibly some settings to be made in your mail client, to allow >it to better separate your text from the text you are answering? I see >that you are using a html client while I - as a lot of other users - are >using text clients. As you can see from the attached text, it really is >hard to separate your text from Satish's. > >If nothing else is possible, maybe you may write GD: at the start of each >of your lines. I don't want to read the original questions multiple times, >just locate the answers and see if I'm satisfied, or if I maybe have some >more comments on the issue at hand. > >/Per W > >On Mon, 21 Jul 2003, Graham Douglas wrote: > > > >>Satish Medepalli wrote: >> >> 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(); >> >>You can't do that, either >> >> 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?? >> >>No, it's not and, like others I can't see a need. >> >> Thank You in advance. >>-Sateesh Medepalli >> >> >> > > > > >------------------------------------------------------- >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: Per W. <pw...@ia...> - 2003-07-21 20:47:36
|
Hi Graham! Is there possibly some settings to be made in your mail client, to allow it to better separate your text from the text you are answering? I see that you are using a html client while I - as a lot of other users - are using text clients. As you can see from the attached text, it really is hard to separate your text from Satish's. If nothing else is possible, maybe you may write GD: at the start of each of your lines. I don't want to read the original questions multiple times, just locate the answers and see if I'm satisfied, or if I maybe have some more comments on the issue at hand. /Per W On Mon, 21 Jul 2003, Graham Douglas wrote: > > > Satish Medepalli wrote: > > 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(); > > You can't do that, either > > 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?? > > No, it's not and, like others I can't see a need. > > Thank You in advance. > -Sateesh Medepalli > |
|
From: Ioannis V. <iv...@em...> - 2003-07-21 20:16:35
|
> -----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 Strangely enough I did not receive your email and I am answering it through Marc Heiligers 's email. After the compilation no object has any name. So you can't define its name at run time (and even if they had, how would that be useful to you?) . 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: Michal M. <mol...@se...> - 2003-07-21 18:39:39
|
Yeoh HS wrote: > Is there a Windows port of ncurses? > > Best Regards, > Yeoh _n_curses maybe as a part of cygwin but curses for windows are generally available as a part of the PDCurses: http://pdcurses.sourceforge.net/ (or you can try my DevPak: http://molhanec.net/pdcurses.DevPak ) |
|
From: Graham D. <g.d...@nt...> - 2003-07-21 18:11:31
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"> <title></title> </head> <body> <br> <br> Satish Medepalli wrote:<br> <blockquote type="cite" cite="mid...@we..."> <pre wrap="">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();</pre> </blockquote> You can't do that, either<br> <blockquote type="cite" cite="mid...@we..."> <pre wrap=""> 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??</pre> </blockquote> No, it's not and, like others I can't see a need.<br> <blockquote type="cite" cite="mid...@we..."> <pre wrap=""> Thank You in advance. -Sateesh Medepalli __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! <a class="moz-txt-link-freetext" href="http://sbc.yahoo.com">http://sbc.yahoo.com</a> ------------------------------------------------------- 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: <a class="moz-txt-link-freetext" href="http://www.vmware.com/wl/offer/345/0">http://www.vmware.com/wl/offer/345/0</a> _______________________________________________ Dev-cpp-users mailing list <a class="moz-txt-link-abbreviated" href="mailto:Dev...@li...">Dev...@li...</a> TO UNSUBSCRIBE: <a class="moz-txt-link-freetext" href="http://www23.brinkster.com/noicys/devcpp/ub.htm">http://www23.brinkster.com/noicys/devcpp/ub.htm</a> <a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/dev-cpp-users">https://lists.sourceforge.net/lists/listinfo/dev-cpp-users</a> </pre> </blockquote> </body> </html> |
|
From: Graham D. <g.d...@nt...> - 2003-07-21 18:03:23
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
<title></title>
</head>
<body>
<br>
<br>
<a class="moz-txt-link-abbreviated" href="mailto:pr...@le...">pr...@le...</a> wrote:<br>
<blockquote type="cite"
cite="midOF20FBEAD4.74884782-ON65256D6A.0036EE15@com">
<pre wrap="">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.</pre>
</blockquote>
But you might implement it in multiple derived classes. By defining it
in the base class, you can call the functionthrough the base class <span
style="font-style: italic;">without knowing what the actual derived
class is</span>. The declaration (and possible definition) in the base
class is defining a <span style="font-style: italic;">contract</span>
that all derived classes should implement. If you make the virtual
function pure (using the = 0 specifier), then you force derived classes
to implement that part of the contract (otherwise, the base provides a
default implementation that derived clases may or may not override). In
this way, you can write code against the base class's contract and know
that all derived classes will fulfill that contract.<br>
<br>
It's called an abstraction. You can define the concept, without
defining the details. For example, you can say that all birds fly
(well, apart from a few, but let's ignore them). However, different
birds fly in different ways: sparrows flap their wings furiously, while
albatrosses glide majestically. Now, there will be situations where
you're only interested in the fact that a bird flies, not in how it
flies. Your base class virtual function (bird::fly()) deals with the
fact of flying, so you might have a function:<br>
<br>
<span style="font-family: monospace;">void migrate(bird* b)</span><br
style="font-family: monospace;">
<span style="font-family: monospace;">{</span><br
style="font-family: monospace;">
<span style="font-family: monospace;"> b->fly();</span><br
style="font-family: monospace;">
<span style="font-family: monospace;">}</span><br>
<br>
The thing about this function is that it is general. No matter what
specific bird you call the function with, it will work. So, if we have
a <span style="font-family: monospace;">class albatross</span> and a <span
style="font-family: monospace;">class sparrow</span> both derived from
<span style="font-family: monospace;">bird</span>, we can call <span
style="font-family: monospace;">migrate()</span> with objects of both
of those classes. Within <span style="font-family: monospace;">migrate()</span>,
the <span style="font-family: monospace;">sparrow </span>will do it
differently to the <span style="font-family: monospace;">albatross</span>,
but migrate doesn't care how, only that they do it.<br>
<blockquote type="cite"
cite="midOF20FBEAD4.74884782-ON65256D6A.0036EE15@com">
<pre wrap="">
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: <a class="moz-txt-link-freetext" href="http://www.vmware.com/wl/offer/345/0">http://www.vmware.com/wl/offer/345/0</a>
_______________________________________________
Dev-cpp-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Dev...@li...">Dev...@li...</a>
TO UNSUBSCRIBE: <a class="moz-txt-link-freetext" href="http://www23.brinkster.com/noicys/devcpp/ub.htm">http://www23.brinkster.com/noicys/devcpp/ub.htm</a>
<a class="moz-txt-link-freetext" href="https://lists.sourceforge.net/lists/listinfo/dev-cpp-users">https://lists.sourceforge.net/lists/listinfo/dev-cpp-users</a>
</pre>
</blockquote>
</body>
</html>
|
|
From: Abhijit S. <mu...@gm...> - 2003-07-21 17:45:08
|
Hello, Satish.
> I have the following requirement while creating objects.. I will try to
> explain it using a small example..
Well, for one, you have to get it out of your head that the name of the
object changes its behaviour, or, for that matter, your understanding of the
program.
If what you want is to be able to tell who the student is from the object,
simply add a variable to store the name of your student:
class Student
{
// foo.
char *student_name;
};
And create some mutators/accessors/constructors/whatever that work with this
new member.
--
Abhijit Shylanath
Homepage: http://mudeth.tripod.com/
|