dev-cpp-users Mailing List for Dev-C++ (Page 340)
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: P.D. v. Z. <pa...@my...> - 2003-07-27 17:46:47
|
Hello again,
So THAT's what I was doing wrong! *slaps forehead*
I don't have much experience with template member functions yet, it's
the first time I've used it in a real project. I called the function as
follows (from within a member function of the Config class):
ConfigParser cp;
cp.Parse("somefile.conf", this, &Config::ConfigData);
Which apparently should have been:
ConfigParser cp;
cp.Parse<Config>("somefile.conf", this, &Config::ConfigData);
From the examples and help I found online I got the impression that this
template parameter was implicit... apparently not :) First I thought it
was something I did wrong with the body of the function (not specifying
things that I should, for instance), because almost everywhere the
samples only present inlined code.
But anyway, thanks a lot! Now I can continue with my (much too
time-consuming) little project :)
Greetings,
Paul
-----Original Message-----
From: dev...@li...
[mailto:dev...@li...] On Behalf Of Hossein
Haeri
Sent: Sunday, July 27, 2003 5:34 PM
To: dev...@li...
Subject: Re: [Dev-C++] Template member function (C++ obviously)
Dear Paul,
> I hope anyone can help me, cause I'm starting to consider making the
> entire class a template, just to get rid of the linker error. I
> already switched from Visual C++ 6 to GCC because of one of the many
> bugs in
> VC++6, one of which is that it doesn't seem to understand/support
> template member functions.
Oh, yes! Member templatisation is one of the C++ features that the nasty
MSVC++6 doesn't supports. One of bewildering (known) bugs of it! That's
whilst member templatatisation is completely Standard-compliant, and
that's a shame, out of thousands, for MSVC++6!
Hmmm... One point more: I know that you told the error is engendered by
the linker, but consider the following peice of code which I site
directly from TC++PL:Spec (Section C.13.6):
class Memory{
public:
template<class T> T* get_new();
template<class T> void release(T&);
};
template<class Allocator> void f(Allocator& m)
{
int* p1 = m.get_new<int>();
//Syntax Error: int after less than operator
int* p2 = m.template get_new<int>();
//explicit qualification
//...
m.release(p1);
//template argument deduced: no explicit qualification needed
m.release(p2);
}
Are you sure that's not arisen because of forgetting the "template
qualifier?"
Regards,
--Hossein
--
__________________________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup
CareerBuilder.com has over 400,000 jobs. Be smarter about your job
search http://corp.mail.com/careers
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01
/01
_______________________________________________
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: Tom C. <jat...@nt...> - 2003-07-27 17:26:11
|
"P.D. van Zelst" <pa...@my...> writes: > I'm trying to implement a pointer-to-member callback function in one of > my classes, and I finally seem to have the syntax right. I have a member > function whose prototype looks like this: > > template<typename T> void Parse(const std::string& strFile, T* pClass, > bool (T::* pCB)(const ConfigLine&)) > > It's a member function of a non-template class ConfigParser. When I try > to use this function however, I get a linker error. "[Linker error] > undefined reference to `void ConfigParser::Parse<Config>(std::string > const&, Config*, bool (Config::*)(ConfigLine const&))'" Try placing the definition of ConfigParser::Parse in a separate header file, which you should then #include at the bottom of the header file containing the class definition of ConfigParser. It means more must be recompiled when either header file is changed, but it's the only solution I've found to this most annoying of problems. I understand the C++ 'export' keyword is designed to alleviate the problem, but neither GCC nor Visual C++ currently supports it. --Tom |
|
From: Hossein H. <ult...@em...> - 2003-07-27 15:35:33
|
Dear Paul,
> I hope anyone can help me, cause I'm starting to consider making the
> entire class a template, just to get rid of the linker error. I already
> switched from Visual C++ 6 to GCC because of one of the many bugs in
> VC++6, one of which is that it doesn't seem to understand/support
> template member functions.
Oh, yes! Member templatisation is one of the C++ features that the
nasty MSVC++6 doesn't supports. One of bewildering (known) bugs of it!
That's whilst member templatatisation is completely Standard-compliant,
and that's a shame, out of thousands, for MSVC++6!
Hmmm... One point more: I know that you told the error is engendered by
the linker, but consider the following peice of code which I site
directly from TC++PL:Spec (Section C.13.6):
class Memory{
public:
template<class T> T* get_new();
template<class T> void release(T&);
};
template<class Allocator> void f(Allocator& m)
{
int* p1 = m.get_new<int>();
//Syntax Error: int after less than operator
int* p2 = m.template get_new<int>();
//explicit qualification
//...
m.release(p1);
//template argument deduced: no explicit qualification needed
m.release(p2);
}
Are you sure that's not arisen because of forgetting the "template
qualifier?"
Regards,
--Hossein
--
__________________________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup
CareerBuilder.com has over 400,000 jobs. Be smarter about your job search
http://corp.mail.com/careers
|
|
From: Per W. <pw...@ia...> - 2003-07-27 15:04:11
|
But that's not what FerretallicA wanted. He tried to implement main.h: #ifndef _MAIN_H_ ... #if INSTANTIATE_GLOBALS #define GLOBAL #else #define GLOBAL extern #endif GLOBAL int some_important_variable; #endif _MAIN_H_ main.cpp: #define INSTANTIATE_GLOBALS #include "main.h" // Instantiate needed global variables. extrafunctions.cpp: #include "main.h" // Just thell what global variables are available. Renaming PRAGMAONCE to _MAIN_H would still result in all source files including main.h getting a copy of the global variable. /Per W On Sun, 27 Jul 2003, OROSZI Bal=E1zs wrote: > FerretallicA wrote: > > Oo oi, > > > > OK got it working... I tried the following code and it made no differen= ce, > > but I tried doing a clean build and now it's worked. The solution is ba= sic, > > but here it is anyway for those who might run into this problem at some > > point. > > > > MAIN.H > > #ifndef PRAGMAONCE > > #define PRAGMAONCE > > int some_important_variable; > > #endif > > > > > > PRAGMAONCE can be renamed to whatever you feel like if you really want. > > It actually SHOULD be renamed, and it should also be unique in each > header file. Because if not, some header files will not be included. > So I suggest, you name it something like this: > > #ifndef _MAIN_H_ > #define _MAIN_H_ > int some_important_variable; > #endif > > -- > Greetings, > Bal=E1zs > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are available now. > Download today and enter to win an XBOX or Visual Studio .NET. > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/= 01 > _______________________________________________ > 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-27 14:58:14
|
Your second solution, the one with // main.h extern int some_important_variable; // main.cpp int some_important_variable; should work too - it's the normal way of accessing a variable between multiple modules. I assume that all you needed to to was to perform a full rebuild, since the extrafunctions.cpp already contained it's own copy of the variable. /Per W On Sun, 27 Jul 2003, FerretallicA wrote: > Oo oi, > > OK got it working... I tried the following code and it made no difference, > but I tried doing a clean build and now it's worked. The solution is basic, > but here it is anyway for those who might run into this problem at some > point. > > MAIN.H > #ifndef PRAGMAONCE > #define PRAGMAONCE > int some_important_variable; > #endif > > > PRAGMAONCE can be renamed to whatever you feel like if you really want. > > -FerretallicA > > ----- Original Message ----- > From: "FerretallicA" <fer...@ho...> > To: "Dev-C++ Users Mailing List" <dev...@li...> > Sent: Sunday, July 27, 2003 4:03 PM > Subject: [Dev-C++] Multiply-included header problem > > > Oo oi, > > I have a bit of a dilemma, albiet a seemingly simplistic one... > Say I have 3 files as follows- > > > MAIN.CPP > #include "main.h" > > EXTRAFUNCTIONS.CPP > #include "main.h" > > MAIN.H > int some_variable_important_to_lots_of_functions; > > > I keep getting errors that some_variable_important_to_lots_of_functions is > being redefined. I have tried the "#pragma once" solution which worked with > Visual C++ but it doesn't seem to work in Dev-C++. I tried > the following- > > > MAIN.CPP > #include "main.h" > int some_variable_important_to_lots_of_functions; > > EXTRAFUNCTIONS.CPP > #include "main.h" > > MAIN.H > extern int some_variable_important_to_lots_of_functions; > > > Still the same problem. Does anyone know of a solution to this? Is this some > mistake I am making, a problem with Dev-C++'s compiler, or what? > > -FerretallicA > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are available now. > Download today and enter to win an XBOX or Visual Studio .NET. > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 > _______________________________________________ > 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 > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are available now. > Download today and enter to win an XBOX or Visual Studio .NET. > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 > _______________________________________________ > 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: P.D. v. Z. <pa...@my...> - 2003-07-27 11:58:21
|
Hi, I'm trying to implement a pointer-to-member callback function in one of my classes, and I finally seem to have the syntax right. I have a member function whose prototype looks like this: template<typename T> void Parse(const std::string& strFile, T* pClass, bool (T::* pCB)(const ConfigLine&)) It's a member function of a non-template class ConfigParser. When I try to use this function however, I get a linker error. "[Linker error] undefined reference to `void ConfigParser::Parse<Config>(std::string const&, Config*, bool (Config::*)(ConfigLine const&))'" Now I've browsed through numerous tutorials, checked my "The C++ Programming Language" book, and did a bunch of Google searches, but I still can't find what I'm doing wrong. I could send the relevant code along, but won't bother you with it just yet. I would guess that if I define and implement the template function, I shouldn't be getting any linker errors for whatever type I put into it. I hope anyone can help me, cause I'm starting to consider making the entire class a template, just to get rid of the linker error. I already switched from Visual C++ 6 to GCC because of one of the many bugs in VC++6, one of which is that it doesn't seem to understand/support template member functions. Thanks in advance, Paul |
|
From: Hossein H. <ult...@em...> - 2003-07-27 11:06:43
|
Dear Christian,
> ich want to write a component to share data (PVOID) between threads.
>
> I have a class defined like the following:
>
> class CDataExchange
> {
> Public:
> stuff....
> private:
> PVOID pDataArray[1000];
> };
>
>
> in the AddData member I look the number of entrys and reallocate memmory for
> that pointer
>
> realloc(pDataArry[n], nDataLength);
Why don't you use Loki::SmartPtr<>, or boost::shared_ptr<>? There,
these issues are all solved in far days before.
Regards,
--Hossein
--
__________________________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup
CareerBuilder.com has over 400,000 jobs. Be smarter about your job search
http://corp.mail.com/careers
|
|
From: Hossein H. <ult...@em...> - 2003-07-27 10:46:28
|
Dear Andre, > How could be a C code to have (print for example) all possible > combinations in the Do you have to use poor C? or can you use C++ as well? If C++ is OK, it seems that I can give you neat solutions. It is enough to just keep in touch! Regards, --Hossein -- __________________________________________________________ Sign-up for your own FREE Personalized E-mail at Mail.com http://www.mail.com/?sr=signup CareerBuilder.com has over 400,000 jobs. Be smarter about your job search http://corp.mail.com/careers |
|
From: <or...@vp...> - 2003-07-27 08:34:58
|
FerretallicA wrote: > Oo oi, > > OK got it working... I tried the following code and it made no difference, > but I tried doing a clean build and now it's worked. The solution is basic, > but here it is anyway for those who might run into this problem at some > point. > > MAIN.H > #ifndef PRAGMAONCE > #define PRAGMAONCE > int some_important_variable; > #endif > > > PRAGMAONCE can be renamed to whatever you feel like if you really want. It actually SHOULD be renamed, and it should also be unique in each header file. Because if not, some header files will not be included. So I suggest, you name it something like this: #ifndef _MAIN_H_ #define _MAIN_H_ int some_important_variable; #endif -- Greetings, Balázs |
|
From: FerretallicA <fer...@ho...> - 2003-07-27 06:15:04
|
Oo oi, OK got it working... I tried the following code and it made no difference, but I tried doing a clean build and now it's worked. The solution is basic, but here it is anyway for those who might run into this problem at some point. MAIN.H #ifndef PRAGMAONCE #define PRAGMAONCE int some_important_variable; #endif PRAGMAONCE can be renamed to whatever you feel like if you really want. -FerretallicA ----- Original Message ----- From: "FerretallicA" <fer...@ho...> To: "Dev-C++ Users Mailing List" <dev...@li...> Sent: Sunday, July 27, 2003 4:03 PM Subject: [Dev-C++] Multiply-included header problem Oo oi, I have a bit of a dilemma, albiet a seemingly simplistic one... Say I have 3 files as follows- MAIN.CPP #include "main.h" EXTRAFUNCTIONS.CPP #include "main.h" MAIN.H int some_variable_important_to_lots_of_functions; I keep getting errors that some_variable_important_to_lots_of_functions is being redefined. I have tried the "#pragma once" solution which worked with Visual C++ but it doesn't seem to work in Dev-C++. I tried the following- MAIN.CPP #include "main.h" int some_variable_important_to_lots_of_functions; EXTRAFUNCTIONS.CPP #include "main.h" MAIN.H extern int some_variable_important_to_lots_of_functions; Still the same problem. Does anyone know of a solution to this? Is this some mistake I am making, a problem with Dev-C++'s compiler, or what? -FerretallicA ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 _______________________________________________ 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: FerretallicA <fer...@ho...> - 2003-07-27 06:01:03
|
Oo oi, I have a bit of a dilemma, albiet a seemingly simplistic one... Say I have 3 files as follows- MAIN.CPP #include "main.h" EXTRAFUNCTIONS.CPP #include "main.h" MAIN.H int some_variable_important_to_lots_of_functions; I keep getting errors that some_variable_important_to_lots_of_functions is being redefined. I have tried the "#pragma once" solution which worked with Visual C++ but it doesn't seem to work in Dev-C++. I tried the following- MAIN.CPP #include "main.h" int some_variable_important_to_lots_of_functions; EXTRAFUNCTIONS.CPP #include "main.h" MAIN.H extern int some_variable_important_to_lots_of_functions; Still the same problem. Does anyone know of a solution to this? Is this some mistake I am making, a problem with Dev-C++'s compiler, or what? -FerretallicA |
|
From: Gabriel M. <g.m...@in...> - 2003-07-26 07:49:35
|
Hi all, does it exist a dev-C++ project for building FLTK (Fast Light Toolkit)? I tried to build it via command line without success, because I cannot correctly configure FLTK to be compiled with the devcpp distribution of MinGW Thanks in advance -- Gabriel Maldonado http://csounds.com/maldonado/home2.htm -- |
|
From: <or...@vp...> - 2003-07-26 07:06:32
|
Ioannis Vranos wrote: >>-----Original Message----- >>From: dev...@li... >>[mailto:dev...@li...] On Behalf >>Of OROSZI Bal?zs >>Sent: Friday, July 25, 2003 1:34 PM >>To: dev...@li... >>Subject: Re: [Dev-C++] moving to 3d programming >> >>With the upcoming OpenGL 2.0 standard, > > I guess this answers my question whether it has been ratified or not yet. Well, I don't exactly know where they are with it. They said, it will be done this summer. I think I'll visit http://www.opengl.org about it, as I am also not sure. As I saw, they are at 1.5 now. But 2.0 will surely be different, just as you said. I hope they won't make it overcomplicated. -- Greetings, Balázs |
|
From: David M. <ci...@ya...> - 2003-07-26 03:03:58
|
Hmm,
Some interesting comments. (I know I need to increment the
iterator, I
forgot that when I sent this e-mail). So far the only
optimization that
would be applicable is the passing by refrence. This
program is
multi-threaded so even though I could use mutexes, etc. to
prevent the
string from changing between calls to write_to_player I
would rather not
have that headache. If you are wondering I plan to put the
map in a
Read-write mutex (the only time that map changes is when a
player logs in or
logs out).
Thanks for all your comments.
----- Original Message -----
From: "P.D. van Zelst" <pa...@my...>
To: <ci...@ya...>
Sent: Friday, July 25, 2003 7:18 AM
Subject: RE: [Dev-C++] Optimizing using the STL
> Hi,
>
> Well, incrementing the iterator inside your while loop
would be a
> performance improvement I suppose :P
> And to nitpick about the arguments a bit... it would be
more efficient
> to pass the string as a const string&.
> But other than that I wouldn't know how to optimize this
function any
> further. I know there's a template function "memfun",
which allows you
> to call member functions in objects, but I don't know if
it's possible
> to pass parameters to that.
>
> Regards,
>
>
> Paul
>
> -----Original Message-----
> From: dev...@li...
> [mailto:dev...@li...] On
Behalf Of David
> McKen
> Sent: Thursday, July 24, 2003 9:17 PM
> To: Dev-C Mailing List
> Subject: [Dev-C++] Optimizing using the STL
>
>
> Any suggestions on how I can optimized the following
> function?
>
> void pc_char::write_to_all_pc(string to_send, bool
> add_eoln)
> {
> map<string, pc_char *>::iterator i =
> current_players.begin();
>
> while (i != current_players.end()) {
> (*i).second->write_to_player(to_send, add_eoln);
> }
> }
>
> I was hoping to use for_each but kept coming across the
> problem of "How the hell am I going to pass the arguments
> to write_to_player?"
>
> Thanks in Advance
>
> =====
> Signed
> David Mcken
>
> Life Sucks
> Live with it
>
> __________________________________
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design
software
> http://sitebuilder.yahoo.com
>
>
> -------------------------------------------------------
> This SF.Net email sponsored by: Free pre-built ASP.NET
sites including
> Data Reports, E-commerce, Portals, and Forums are
available now.
> Download today and enter to win an XBOX or Visual Studio
.NET.
>
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01
> /01
> _______________________________________________
> 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
>
>
__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com
|
|
From: Ioannis V. <iv...@em...> - 2003-07-25 23:36:12
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of OROSZI Bal?zs > Sent: Friday, July 25, 2003 1:34 PM > To: dev...@li... > Subject: Re: [Dev-C++] moving to 3d programming > > With the upcoming OpenGL 2.0 standard, I guess this answers my question whether it has been ratified or not yet. 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: Ioannis V. <iv...@em...> - 2003-07-25 23:34:44
|
> -----Original Message----- > From: dev...@li...=20 > [mailto:dev...@li...] On Behalf=20 > Of OROSZI Bal?zs > Sent: Friday, July 25, 2003 1:44 PM > To: dev...@li... > Subject: Re: [Dev-C++] moving to 3d programming >=20 >=20 > Hi! >=20 > I forgot one more thing: DirectX tends to be incompatible.=20 > For example:=20 > 3DMark 2001 uses DirectX 8.1, but if you upgrade to DirectX=20 > 9, then 3D=20 > Mark 2001 won't run. So you might as well have problems in this area,=20 > while with the carefully designed OpenGL API, you'll not. > BTW John Carmack also recommends OpenGL (and so does he uses it too),=20 > and "unrecommends" DirectX. Of course, Quakes and other ID stuff use OPENGL. OPENGL is standardised = by a board of graphics companies. And the new OPENGL standard (I do not know if it is still upcoming or = not) is completely object oriented. 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: <ten...@ne...> - 2003-07-25 16:11:23
|
Just as pointed by Zodiaq, if I use an statically allocated static array of COLORREFS (;static COLORREF rgbCust[16];etc) instead a dinamically allocated pointer the problem I mentioned dissappears. Thanks. |
|
From: Abhijit S. <mu...@gm...> - 2003-07-25 14:26:26
|
Addendum: > > void pc_char::write_to_all_pc(string to_send, bool And another thing; wherever possible, pass by reference rather than by value. It's much more efficient for classes. For example, make write_to_all_pc: void pc_char::write_to_all_pc(const string &to_send, bool whatever) Note that the `const' also helps in optimization; gcc will know that the parameter is not modified, and make optimization arrangements based on this. This should actually give you more of a speed-boost than the previous thing I suggested. PS: As I mentioned, I am not an STL-wise person, so if the above optimization is insignificant because of the way the string class works, sorry. -- Abhijit Shylanath Homepage: http://mudeth.tripod.com/ |
|
From: Abhijit S. <mu...@gm...> - 2003-07-25 13:55:05
|
> DirectX is used by many many people and organisations. Microsoft recently > removed themselves from the OpenGL consortium (or whatever its > called) as a > side note. All the more reason to do OpenGL! :-) Microsoft pulled out because OpenGL was challenging its monopoly. Even from a neutral (non-anti-M$) view, one has to agree that OpenGL is usually the most efficient, stable, and widely-supported. If you had a choice between having your graphics code compile only on one platform, versus having it compile with few changes on two, which would you go for? One thing that amuses me was that before DirectX was such hot property, M$ used to distribute OpenGL screen-savers along with Windows. It just goes to show their monopolistic ideals that even with OpenGL being good enough for them to use to make screen-savers for Windows, they decided to go ahead with Direct3D... not to create a better API, but to create an MS API. > > I reckon DirectX is the way to go, you know 2D programming and Dx > has (had) > a 2D component, which is now part of Direct3D. > > Check out GamesDev.Net gamedev.net? Specifically, for OpenGL, see http://nehe.gamedev.net/ Also, for 2D, you might want to try using Allegro (see http://www.allegro.cc and http://alleg.sourceforge.net - not sure about the second one). This is a cross-platform library for graphics, sound, input, timing, etc. Used in conjunction, you can very easily port your code across different platforms. Allegro does use DirectDraw on Windows, if it's available. -- Abhijit Shylanath Homepage: http://mudeth.tripod.com/ |
|
From: Abhijit S. <mu...@gm...> - 2003-07-25 13:54:57
|
Hello, David.
> Any suggestions on how I can optimized the following
> function?
>
> void pc_char::write_to_all_pc(string to_send, bool
> add_eoln)
> {
> map<string, pc_char *>::iterator i =
> current_players.begin();
>
> while (i != current_players.end()) {
> (*i).second->write_to_player(to_send, add_eoln);
> }
> }
>
> I was hoping to use for_each but kept coming across the
> problem of "How the hell am I going to pass the arguments
> to write_to_player?"
I'm not exactly an STL hacker, so I wouldn't know if there's a more elegant
solution, but here's my idea:
You can maintain a namespace with pointers to arguments for
write_to_player() and empty-out the arg-list of write_to_player() (and
probably write an inline wrapper to map from arg-list to this namespace for
normal calls). Then intially set up to_send and add_eoln in that namespace
and call for_each() with begin and end. This will work here because the
arguments are common.
--
Abhijit Shylanath
Homepage: http://mudeth.tripod.com/
|
|
From: Abhijit S. <mu...@gm...> - 2003-07-25 13:54:53
|
> -----Original Message----- > From: Christian Wallukat [mailto:Chr...@vo...] > Sent: Friday, July 25, 2003 5:54 PM > To: Abhijit Shylanath > Subject: AW: [Dev-C++] Deleting an array > > > Hi Abhijit, > > > How can I do that ? > > In fact I need an array of something, where I can write Data into it. > > My idea is to use the array of PVOID[] in case of accessing over the > PVOID[nNum], > Allocate memory realloc(PVOID[nNum], nSize); > > Any idea how i can do it ? > > > Kind regards > > Christian Actually, the code that you're using should be alright for your purposes, except for this: When you delete[] pDataArray, you're actually delete'ing the array declared like this: PVOID pDataArray[1000]; NOT the array you allocated like this: realloc(pDataArray[n], len); That's why the error: you're trying to delete[] pDataArray, which was never really new'ed. To free pDataArray[n], use free(pDataArray[n]) (simple, isn't it? :-). Note that data allocated with new should be delete'd, data allocated with malloc() and its counterparts should be free()'d. They may allocate from separate heaps, so you should not mix them. So, to fix your above problem, you simply do free(pDataArray[n]); instead of delete[] pDataArray. Another thing, which I don't know if you're doing already is to NULL out all the members of pDataArray at init-time. This is because of the working of realloc(). If it gets a NULL pointer as its argument, it works like malloc(). And the first time you allocate, it SHOULD work like malloc. HTH. PS: When you intend to post to the list, you have to `Reply All', not `Reply'; otherwise only the sender will receive your reply, not the list. This is a quirk of the mail-server used. -- Abhijit Shylanath Homepage: http://mudeth.tripod.com/ |
|
From: Abhijit S. <mu...@gm...> - 2003-07-25 13:54:49
|
> Is there any provision of using variable of type int64 > in Dev-c++. Microsoft visual studio has that > provision. Use the type `long long' (yes, repeated). Example: long long foo; // sizeof(foo) will give you `8' -- Abhijit Shylanath Homepage: http://mudeth.tripod.com/ |
|
From: Damien <g_...@ho...> - 2003-07-25 12:26:57
|
<html><div style='background-color:'><DIV> <P>Well, even though the arguments presented on why to or not to use D3D/OpenGL may be valid, it really depends on what you plan on doing. Both APIs are very good, and Direct3D is getting revised so quickly that right now, OpenGL is trying to catch up (not like 5 or more years ago when I believe it was the reverse order). If you can handle COM(Compnoent Object Model), go ahead with D3D. Syntax-wise, D3D is harder to break into, OpenGL is much easier. If you have learnt DirectDraw already, OpenGL's cross-platform capabilities is no argument to use it, as I believe you are sticking with Windows(one of the reasons why John Carmack(a well-note OpenGL programmer) may recommend OpenGL is because his games are not Windows specific). Personally, I learnt OpenGL first, and am learning DirectX(dinput,dsound,d3d) now.<BR></P></DIV> <DIV></DIV>----Original Message Follows---- <DIV></DIV>From: OROSZI Balázs <OR...@VP...> <DIV></DIV>To: dev...@li... <DIV></DIV>Subject: Re: [Dev-C++] moving to 3d programming <DIV></DIV>Date: Fri, 25 Jul 2003 12:44:09 +0200 <DIV></DIV>MIME-Version: 1.0 <DIV></DIV> <DIV></DIV>Hi! <DIV></DIV> <DIV></DIV>I forgot one more thing: DirectX tends to be incompatible. For example: 3DMark 2001 uses DirectX 8.1, but if you upgrade to DirectX 9, then 3D Mark 2001 won't run. So you might as well have problems in this area, while with the carefully designed OpenGL API, you'll not. <DIV></DIV>BTW John Carmack also recommends OpenGL (and so does he uses it too), and "unrecommends" DirectX. <DIV></DIV> <DIV></DIV>-- <DIV></DIV>Greetings, <DIV></DIV>Balázs <DIV></DIV> <DIV></DIV> <DIV></DIV> <DIV></DIV>------------------------------------------------------- <DIV></DIV>This SF.Net email sponsored by: Free pre-built ASP.NET sites including <DIV></DIV>Data Reports, E-commerce, Portals, and Forums are available now. <DIV></DIV>Download today and enter to win an XBOX or Visual Studio .NET. <DIV></DIV>http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 <DIV></DIV>_______________________________________________ <DIV></DIV>Dev-cpp-users mailing list <DIV></DIV>Dev...@li... <DIV></DIV>TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm <DIV></DIV>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users <DIV></DIV></div><br clear=all><hr>Help STOP SPAM with <a href="http://g.msn.com/8HMGEN/2731??PS=">the new MSN 8 </a> and get 2 months FREE*</html> |
|
From: <or...@vp...> - 2003-07-25 10:43:51
|
Hi! I forgot one more thing: DirectX tends to be incompatible. For example: 3DMark 2001 uses DirectX 8.1, but if you upgrade to DirectX 9, then 3D Mark 2001 won't run. So you might as well have problems in this area, while with the carefully designed OpenGL API, you'll not. BTW John Carmack also recommends OpenGL (and so does he uses it too), and "unrecommends" DirectX. -- Greetings, Balázs |
|
From: <or...@vp...> - 2003-07-25 10:33:23
|
Daniel Glenfield wrote: > DirectX is used by many many people and organisations. Microsoft > recently removed themselves from the OpenGL consortium (or whatever its > called) as a side note. > > I reckon DirectX is the way to go, you know 2D programming and Dx has > (had) a 2D component, which is now part of Direct3D. With the upcoming OpenGL 2.0 standard, things are going to change. Lots of new features come. But the main reason why I think yo should use OpenGL, is because it is cross-platform. No wonder why M$ removed themselves from the OpenGL consortium - they want developers to use D3D, so that way they will be limited to Windows only. And of course this "used by many many people" is a platitude. OpenGL is also "used by many many people". -- Greetings, Balázs |