dev-cpp-users Mailing List for Dev-C++ (Page 389)
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: Ioannis V. <iv...@at...> - 2003-05-01 15:02:42
|
-----Original Message----- From: dev...@li... [mailto:dev...@li...] On Behalf Of David = McKen Sent: Thursday, May 01, 2003 4:10 PM To: dev...@li... Subject: [Dev-C++] 'extern const' and std::vector My first question concerns the extern keyword. =20 If I have a varible in one file (it is not a constant) but that varible needs to accessed from the functions in another file. However these = other functions do not need (actually I don't want them to have) write access = to this variable, can I do something similar to 'const <var_type> = <var_name>?'. For those of you who are wondering why I don;t just try it myself I = would like to know what EVERY ANSI compatible compiler will do. The program I = am writing must remain portable. =20 =20 You do not specify language. That creates extra pain. In C & C++ yes you = can do extern const int x; In C++ you have better use a namespace. =20 My other question concerns the std::vector container class of the STD. =20 As far as I have seen the std:vector class stores it's contents = contiguously in memory (just like an array). Does this make vector classes reach = their maximum size once there is no block of memory big enough to hold it's = data?=20 =20 You haven't to worry about these details. It is an implementation worry = and in reality the vector is just a handler interface. That's why the vector::swap() works instantly. Also you can specify for it your own = memory allocator. But handlers and allocators are advanced magic for me yet so = i can't tell you more on that till i end TC++PL3. :) =20 =20 In any case you have not to worry about these details. =20 =20 =20 I plan to use this class to act as the index for world system with up = to 2^32 rooms in it (even if I store only pointers to each structure it = still gets pretty big). Would any of the other containers be better suited to = this purpose? I chose the vector bacause of it's speed (4 billion possible = rooms, gonna need the speed). The requirements for the container is to allow = for a numbering system for eah of the rooms with rooms being grouped within ranges.=20 =20 Regarding constant random access with [] time cost: vector, deque, = string, valarray and bitset have this. =20 =20 Reference for all the time costs for all containers for all types of = access ([], front operations, etc): =20 "The C++ Programming Language" 3rd Edition or Special Edition by Bjarne Stroustrup (the creator of C++): =20 On page 464. =20 =20 =20 =20 Ioannis Vranos * Programming pages: <http://www.noicys.freeurl.com/> http://www.noicys.freeurl.com * Alternative URL 1: <http://run.to/noicys> http://run.to/noicys * Alternative URL 2: <http://www.noicys.cjb.net/> = http://www.noicys.cjb.net Anti-racism movement: <http://www.positive-youthfoundation.org/> http://www.positive-youthfoundation.org Iraq Peace Pledge: <http://www.peacepledge.org/> = http://www.peacepledge.org =20 |
|
From: Per W. <pw...@ia...> - 2003-05-01 14:39:11
|
I'm not too good at the latest updates of the standards, but to the best of my knowledge, there is no const extern declarations. Extern is just a keyword to inform the compiler that somewhere in another linking unit, the specified variable or function exists. However, you can not just lie, because when you reference the symbol, the compiler will insert a name-mangled reference and the linker will then fail if an exactly identical reference isn't available somewhere in one of the included object or library files. Because c++ uses name-mangling, you can't just change the declaration of a variable in your extern statement. There might be C++ compilers that doesn't change the name-mangling for a const contra non-const variable. In that case, this scheme would work for that compiler. However, I'm pretty sure that you would have to search a lot for a compiler with such a name-mangling. If, on the other hand, you declare the variable as "C", you can do just about anything, i.e. you might declare the variable as char in one source file and as unsigned long in another. Then it's up to you to figure out if the program will survive, or if it will go up in a big explosion when you try and run it. About 2^32 elements in a vector - I hope you are running a 64-bit operating system. Even a vector of 2^32 characters would fill the full address space of a 32-bit processor. Ever wondered about the big need of 64-bit processors and operating systems for large database applications? If I assume that you don't need 2^32 elements, just an address range of 2^32, I would suggest a slower (log n) solution using some form of btree or similar. Then you might traverse down the tree until you find the node containing the range, or no match is found. If you don't have to support ranges, but just want to either find an element, or know that it isn't there, go for a hash solution instead. It will perform insert and lookup operations in constant time. /Per W On Thu, 1 May 2003, David McKen wrote: > My first question concerns the extern keyword. If I have a varible in one= file (it is not a constant) but that varible needs to accessed from the fu= nctions in another file. However these other functions do not need (actuall= y I don't want them to have) write access to this variable, can I do someth= ing similar to 'const <var_type> <var_name>?'. For those of you who are won= dering why I don;t just try it myself I would like to know what EVERY ANSI = compatible compiler will do. The program I am writing must remain portable.= My other question concerns the std::vector container class of the STD. As= far as I have seen the std:vector class stores it's contents contiguously = in memory (just like an array). Does this make vector classes reach their m= aximum size once there is no block of memory big enough to hold it's data? = I plan to use this class to act as the index for world system with up to 2^= 32 rooms in it (even if I store only pointers to each structure it still ge= ts pretty big). Would any of the other containers be better suited to this = purpose? I chose the vector bacause of it's speed (4 billion possible rooms= , gonna need the speed). The requirements for the container is to allow for= a numbering system for eah of the rooms with rooms being grouped within ra= nges. > > --------------------------------- > Do you Yahoo!? > The New Yahoo! Search - Faster. Easier. Bingo. |
|
From: David M. <ci...@ya...> - 2003-05-01 13:10:10
|
My first question concerns the extern keyword. If I have a varible in one file (it is not a constant) but that varible needs to accessed from the functions in another file. However these other functions do not need (actually I don't want them to have) write access to this variable, can I do something similar to 'const <var_type> <var_name>?'. For those of you who are wondering why I don;t just try it myself I would like to know what EVERY ANSI compatible compiler will do. The program I am writing must remain portable. My other question concerns the std::vector container class of the STD. As far as I have seen the std:vector class stores it's contents contiguously in memory (just like an array). Does this make vector classes reach their maximum size once there is no block of memory big enough to hold it's data? I plan to use this class to act as the index for world system with up to 2^32 rooms in it (even if I store only pointers to each structure it still gets pretty big). Would any of the other containers be better suited to this purpose? I chose the vector bacause of it's speed (4 billion possible rooms, gonna need the speed). The requirements for the container is to allow for a numbering system for eah of the rooms with rooms being grouped within ranges. --------------------------------- Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. |
|
From: Ensign, D. <DE...@Pa...> - 2003-04-30 14:30:50
|
Morning, Im only in my second chapter of C++ so please bare that in mind. The book Im using is teaching me about VERY BASIC formatting at this point. The book came with Visual Dev 6.0 but I didnt want that so Im using Dev C++. Can someone show me how to display a float and double? WHen I try the float gets chopped off. I cant get cout.precision(); to work either nor the cout.setf(ios::showpoint); I added them like this: cout.setf(ios::showpoint); cout.precision(8); cout << "\n Here is my float variable" << Float; cout.unsetf(ios::showpoint); Thanks in advance for any help anyone can offer. Best, Dane Ensign |
|
From: Ioannis V. <iv...@at...> - 2003-04-30 13:30:30
|
> -----Original Message-----
> From: Astar [mailto:As...@tu...]
> Sent: Wednesday, April 30, 2003 4:21 PM
> To: Ioannis Vranos; Dev-Cpp mail list
> Subject: Re[4]: [Dev-C++] templates and inheritance
>
>
> Hello Ioannis,
>
>
> IV> export template<class T>
> IV> class whatever
> IV> {
> IV> // ...
> IV> };
>
> may be i don't understand you...
> i understand that if i have two files (.h/.cpp) i must dublicate
> definition of template in .cpp file with word "extern". Am I right?
> or i must dublicate definition of template in every file where i use
> it?
You can place the definition in one .cpp file accompanied with the keyword
"export" and its *declaration* in every scope you use the class (usually
using a header file),
OR you can place the *definition* in every scope you use the class (e.g.
using a header file) without the keyword "export" of course.
The keyword export requires serious effort to be implemented, so it is not
supported by most compilers (and there is discussion inside the C++
committee for the upcoming C++0x standard, whether the keyword "export" to
become optional.).
Ioannis Vranos
* Programming pages: http://www.noicys.freeurl.com
* Alternative URL 1: http://run.to/noicys
* Alternative URL 2: http://www.noicys.cjb.net
Anti-racism movement: http://www.positive-youthfoundation.org
Iraq Peace Pledge: http://www.peacepledge.org
|
|
From: Astar <As...@tu...> - 2003-04-30 13:22:42
|
Hello Ioannis,
IV> The definitions of template functions and classes must be provided at every
IV> file you use them. If you wish to place the definition of the template in
IV> one implementation file, you have to use the keyword export. Example:
IV> export template<class T>
IV> class whatever
IV> {
IV> // ...
IV> };
may be i don't understand you...
i understand that if i have two files (.h/.cpp) i must dublicate
definition of template in .cpp file with word "extern". Am I right?
or i must dublicate definition of template in every file where i use
it?
thanx a lot....
IV> However its implementation is very tough, and not many compilers support the
IV> keyword "export".
--
Best regards,
Astar mailto:As...@tu...
|
|
From: Luigi S. <gi...@li...> - 2003-04-30 12:58:30
|
On Wed, Apr 30, 2003 at 09:07:48AM +0530, Smitha V. Babu wrote: > hai to all, > i am a newbie to programming in linux . > I wish to know, how i can debug a simple c program using gdb. > Where can i find the help.... > Hi, I happened to answer a similar question before, so have put some information, I hope enough to get started, at the following address: www.gisan.freeurl.com once there, follow the link to the "tiny debugger tutorial" you see in the left column. The first section of the document is devoted to using Gdb from the command line, this, I hope, will be of some help. -- >> gisan >> |
|
From: David M. <dem...@uw...> - 2003-04-30 12:33:53
|
Package Manager -> *INSTALL* :) At 06:50 PM 29/04/2003 -0700, Luis Westover wrote: > > >I would like to try using GTK+ tools for creating gui but dont know what to >do with a file with the extention .DEVPAK Ive tried the package manager but >it apparently only views installed packs, tried out of pure fustration, >winzip, qzip even though I know they dont use that extention, I even tried >changing extention as when downloading sometimes file extentions screw up >no avail PLEASE HELP I appologize if this is a stupid question but hey Iam >just learning Dev-CPP :-) Do you Yahoo!? > The New Yahoo! Search - Faster. Easier. Bingo. |
|
From: <cg...@wo...> - 2003-04-30 10:00:01
|
In the WINAPI Reference it is said that this field of the structure is used either in open and save file dialogs, so if you are opening a file you can type the name without the extension and then it adds it if it does not find a file with the provided name and without extension. In my trials I've proved to use it, so it displays the files with the extension of the first filter and when typing a name without extension it search for the second one; but it always try to add the first filter of the buffer, or the one pointed by nFilterIndex, but never to the extension assigned to lpszDefExt. So it's a bug in the API or the documentation about what I warn here. I had to pass to the OPENFILENAME the OFN_ENABLEHOOK flag, the hook function and in its WM_INITDIALOG message call the function CommDlg_OpenSave_SetDefExt(GetParent(hwnd)[1], my_defext); [1] This is because the dialog box is the parent of the hwnd that is the HWND parameter of the function, which is UINT APIENTRY. |
|
From: Ioannis V. <iv...@at...> - 2003-04-30 07:08:26
|
Security leak no. However using global variables instead of passing arguments make it extremelly difficult to locate bugs. Also they are not thread safe. Ioannis Vranos * Programming pages: http://www.noicys.freeurl.com * Alternative URL 1: http://run.to/noicys * Alternative URL 2: http://www.noicys.cjb.net Anti-racism movement: http://www.positive-youthfoundation.org Iraq Peace Pledge: http://www.peacepledge.org > -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Christian Schaefer > Sent: Wednesday, April 30, 2003 11:17 AM > To: dev...@li... > Subject: [Dev-C++] globals considered harmful? > > > hi there! > > I wonder if there is any security issue in using global variables? > are they just considered 'un-styleful' or are they a security leak? > > regards > /christian > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > |
|
From: Per W. <pw...@ia...> - 2003-04-30 07:06:05
|
No security leak - the information is stored in the same memory as non-global variables. Its just that it is a bother to keep track of global variables, avoid name-space collision, make sure they have correct values etc. When you encapsulate the data as private in classes, you know that only a couple of methods of that class may change the data, thereby improving the chance of the variables having the correct value. An example: a linked list and a variable storing number of elements in the list. Whenever an element is added or removed from the list, the count variable must also be updated. If the list was global, some other code might insert a new element but forget to update the counter. An other example: How soon do your global variable get the correct value, in case you can't assign the value in the declaration? You have to wait until a specific function is called, but during this time, other code might try to use the global variable. If it is encapsulated, the access methods would know if it has been initialized or not. Third example: in multithreaded environments, every access to the global variable must be protected by a critical section or a mutex or similar, or fatal things can happen to the application. /Per W On 30 Apr 2003, Christian Schaefer wrote: > hi there! > > I wonder if there is any security issue in using global variables? > are they just considered 'un-styleful' or are they a security leak? > > regards > /christian > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: Christian S. <ca...@kr...> - 2003-04-30 06:13:58
|
hi there! I wonder if there is any security issue in using global variables? are they just considered 'un-styleful' or are they a security leak? regards /christian |
|
From: Smitha V. B. <smi...@so...> - 2003-04-30 03:36:45
|
hai to all, i am a newbie to programming in linux . I wish to know, how i can debug a simple c program using gdb. Where can i find the help.... Thanking in advance with regards smitha ********************************************************************* Disclaimer: The information in this e-mail and any attachments is confidential / privileged. It is intended solely for the addressee or addressees. If you are not the addressee indicated in this message, you may not copy or deliver this message to anyone. In such case, you should destroy this message and kindly notify the sender by reply email. Please advise immediately if you or your employer does not consent to Internet email for messages of this kind. ********************************************************************* |
|
From: pErCivaL <pma...@nt...> - 2003-04-30 03:34:34
|
Have you tried to install it using the package manager? - it has an install button. :) > Date: Tue, 29 Apr 2003 18:50:50 -0700 (PDT) > From: Luis Westover <wwj...@ya...> > To: dev...@li... > Subject: [Dev-C++] Re: Dev-cpp-users PLEASE HELP!!! > > --0-491199264-1051667450=:78604 > Content-Type: text/plain; charset=us-ascii > > > > I would like to try using GTK+ tools for creating gui but dont know what > to do with a file with the extention .DEVPAK Ive tried the package > manager but it apparently only views installed packs, tried out of pure > fustration, winzip, qzip even though I know they dont use that extention, > I even tried changing extention as when downloading sometimes file > extentions screw up no avail PLEASE HELP I appologize if this is a stupid > question but hey Iam just learning Dev-CPP :-) |
|
From: Mark L. <mli...@ip...> - 2003-04-30 03:30:46
|
On Tue, 29 Apr 2003 18:50:50 -0700 (PDT) Luis Westover <wwj...@ya...> wrote: > I would like to try using GTK+ tools for creating gui but dont know > what to do with a file with the extention .DEVPAK Ive tried the > package manager but it apparently only views installed packs, tried > out of pure fustration, winzip, qzip even though I know they dont use > that extention, I even tried changing extention as when downloading > sometimes file extentions screw up no avail PLEASE HELP I appologize > if this is a stupid question but hey Iam just learning Dev-CPP :-) Package manager should be associated with the .devpak suffix. When you look at the .devpak file in windows explorer, does it have the .devpak icon associated with it? If so, double click the .devpak and it should be installed. If not, fix the association :-) Unfortunately, I'm in the middle of a software reload and programming tools haven't been loaded yet so I can't fiddle further for you :-( |
|
From: Luis W. <wwj...@ya...> - 2003-04-30 01:50:51
|
I would like to try using GTK+ tools for creating gui but dont know what to do with a file with the extention .DEVPAK Ive tried the package manager but it apparently only views installed packs, tried out of pure fustration, winzip, qzip even though I know they dont use that extention, I even tried changing extention as when downloading sometimes file extentions screw up no avail PLEASE HELP I appologize if this is a stupid question but hey Iam just learning Dev-CPP :-) --------------------------------- Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo. |
|
From: Ioannis V. <iv...@em...> - 2003-04-30 00:54:39
|
I think many will find it interesting.
-----Original Message-----
From: Peter Gerwinski [mailto:pe...@g-...] On Behalf Of Peter Gerwinski
Sent: Tuesday, April 29, 2003 10:59 PM
To: Ioannis Vranos
Subject: Re: GNU GPL vs FLA
Dear Ioannis Vranos,
you wrote:
> I checked your web site but I did not understand and I would be grateful
if
> you explained it to me:
>
> Is Fiduciary Licence Agreement (FLA) a replacement for GPL in Europe?
Not at all.
When you write software, it is under your copyright, so it is up to
you to choose a software license (such as the GNU GPL). If someone
breaks your license, it is up to you to sue him - which is a lot of
effort. If you do not have the ressources to make sure that everyone
sticks to the license of your software, the license does not have
much value.
You can use the FLA to enable the FSF/FSFE to do that part for you
when your software license is a Free Software license.
In short: The GPL is something you give to your customers.
If you sign the FLA, you enable the FSF/FSFE to help you to
protect the freedom of your software.
Hope this helps,
Peter
--
Dr. rer. nat. Peter Gerwinski
Free Software Foundation Europe
http://fsfeurope.org
|
|
From: Ioannis V. <iv...@at...> - 2003-04-30 00:54:15
|
> -----Original Message-----
> From: dev...@li...=20
> [mailto:dev...@li...] On Behalf Of Astar
> Sent: Tuesday, April 29, 2003 11:56 PM
> To: Dev-Cpp mail list
> Subject: Re[2]: [Dev-C++] templates and inheritance
>=20
> :)))) very interesting... of course i have main-function (my project
> consist of ~40-45 files and i thought that writing about my
> main-function (and other parts of project) is unnecessary)
>=20
> i find problem (it isn't absence of main-function :)).
>=20
> I have problem with writing implementation of methods
> (constructor/destructor too) in two files. I mean, if i write it only
> in .h file:
> template <class T, int o>
> class CConteiner{
> CConteiner(){....}
> ~CConteiner(){....};
> };
>=20
> it's OK!(compiling and linking) ....... but if i write implementation
> of constructor/destructor in .cpp file i have link error. I write:
>=20
> template <class T, int o>
> CConteiner<T, optimum>::CConteiner(){
> .......
> }
>=20
> template <class T, int o>
> CConteiner<T, optimum>::~CConteiner(){
> .......
> }
>=20
> what's wrong with my code???
> or may be i must write body of methods in declaration?
>=20
>=20
> PS. sorry for my english :)
The definitions of template functions and classes must be provided at =
every
file you use them. If you wish to place the definition of the template =
in
one implementation file, you have to use the keyword export. Example:
export template<class T>
class whatever
{
// ...
};
However its implementation is very tough, and not many compilers support =
the
keyword "export".
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
Anti-racism movement: http://www.positive-youthfoundation.org
Iraq Peace Pledge: http://www.peacepledge.org
|
|
From: Astar <As...@tu...> - 2003-04-29 20:57:14
|
Hello Ioannis,
IV> This code compiles. Find the differences. :)
IV> template <class T, int optimum>
IV> class CConteiner
IV> {
IV> };
IV> class CScene{};
IV> class CScenes:public CConteiner<CScene*, 4>
IV> {
IV> };
IV> int main()
IV> {
IV> }
:)))) very interesting... of course i have main-function (my project
consist of ~40-45 files and i thought that writing about my
main-function (and other parts of project) is unnecessary)
i find problem (it isn't absence of main-function :)).
I have problem with writing implementation of methods
(constructor/destructor too) in two files. I mean, if i write it only
in .h file:
template <class T, int o>
class CConteiner{
CConteiner(){....}
~CConteiner(){....};
};
it's OK!(compiling and linking) ....... but if i write implementation
of constructor/destructor in .cpp file i have link error. I write:
template <class T, int o>
CConteiner<T, optimum>::CConteiner(){
.......
}
template <class T, int o>
CConteiner<T, optimum>::~CConteiner(){
.......
}
what's wrong with my code???
or may be i must write body of methods in declaration?
PS. sorry for my english :)
--
Best regards,
Astar mailto:As...@tu...
|
|
From: <inf...@21...> - 2003-04-29 17:12:25
|
-- <> |
|
From: Ioannis V. <iv...@at...> - 2003-04-29 15:21:57
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Ioannis Vranos > Sent: Tuesday, April 29, 2003 6:07 PM > To: Dev-C++ Mailing List > Cc: Colin Laplace > Subject: [Dev-C++] Fiduciary Licence Agreement (FLA) > Importance: High > > > I just saw it and thought to tell you guys and girls. > > > Since 2001 there is the European Free Softwarre Foundation. > The European GPL > is called "Fiduciary Licence Agreement (FLA)". > > > Coders in Europe should use this instead, because it is more > legal for EU. > > > > More information: > > http://www.fsfeurope.org/projects/fla/index.en.html > > http://mail.fsfeurope.org/pipermail/press-release/2003q1/000049.html Not so sure for the "GPL replacement". It seems more as a replacement for another type of agreement ("Copyright Assignments"). Ioannis Vranos * Programming pages: http://www.noicys.freeurl.com * Alternative URL 1: http://run.to/noicys * Alternative URL 2: http://www.noicys.cjb.net Anti-racism movement: http://www.positive-youthfoundation.org Iraq Peace Pledge: http://www.peacepledge.org |
|
From: Per W. <pw...@ia...> - 2003-04-29 15:10:23
|
I don't run allegro, so I haven't the header files and can compare them
but:
your add_blender8() is a function, and you send it in as a function
pointer to the create_color_table function. The compiler error on the
other hand seem to list a parameter list taking an integer as third
parameter, i.e. the result of the call to add_blender8(xxx).
/Per W
On Tue, 29 Apr 2003, Louis Godio wrote:
> Hi,
> I'm new to the ALLEGRO package and when trying to compile this code
> segment:
>
> /* for generating the 8 bit additive color lookup table */
> static void add_blender8 (PALETTE pal, int x, int y, RGB *rgb)
> { int r, g, b;
> r = (int)pal[x].r + (int)pal[y].r;
> g = (int)pal[x].g + (int)pal[y].g;
> b = (int)pal[x].b + (int)pal[y].b;
> rgb->r = MIN(r, 63);
> rgb->g = MIN(g, 63);
> rgb->b = MIN(b, 63);
> }
>
> int main ();
> .....
>
>
> PALETTE pal;
> COLOR_MAP * color_map;
> RGB_MAP * rgb_map;
>
> color_map = (COLOR_MAP *) malloc(sizeof(COLOR_MAP));
>
> create_color_table (color_map, pal, add_blender8, NULL);
> .....
>
>
> I get the compiler error:
>
> converting `void (*)(RGB *, int, int, RGB *)' to
> `void (*)(const RGB *, int, int, RGB *)' is a
> contravariance violation.
>
>
> Can any ALLEGRO experts help me on eliminating this error ?
>
>
>
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Search - Faster. Easier. Bingo.
> http://search.yahoo.com
>
>
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
|
|
From: Ioannis V. <iv...@em...> - 2003-04-29 15:07:01
|
I just saw it and thought to tell you guys and girls. Since 2001 there is the European Free Softwarre Foundation. The European = GPL is called "Fiduciary Licence Agreement (FLA)". Coders in Europe should use this instead, because it is more legal for = EU. More information:=20 http://www.fsfeurope.org/projects/fla/index.en.html http://mail.fsfeurope.org/pipermail/press-release/2003q1/000049.html 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 Anti-racism movement: http://www.positive-youthfoundation.org Iraq Peace Pledge: http://www.peacepledge.org |
|
From: Ioannis V. <iv...@at...> - 2003-04-29 14:00:32
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Esteban Valverde > Sent: Tuesday, April 29, 2003 4:22 PM > To: dev-cpp > Subject: [Dev-C++] Doble pointer > > > Hi, I can do this: > > int array [ N ]; > int *p = array; > > but I can't do this: > > int matrix [ M ] [ N ]; > int **q = matrix; > > An "suspicius pointer conversion" warning message appear and > the program > halts when I run it. Why can't do this assigment ? Because that is a pointer to pointer. You need a pointer to array, that is: int (*q)[N]=matrix; or int (*q)[N]=&matrix[0]; Ioannis Vranos * Programming pages: http://www.noicys.freeurl.com * Alternative URL 1: http://run.to/noicys * Alternative URL 2: http://www.noicys.cjb.net Anti-racism movement: http://www.positive-youthfoundation.org Iraq Peace Pledge: http://www.peacepledge.org |
|
From: Louis G. <lg...@ya...> - 2003-04-29 13:28:36
|
Hi,
I'm new to the ALLEGRO package and when trying to compile this code
segment:
/* for generating the 8 bit additive color lookup table */
static void add_blender8 (PALETTE pal, int x, int y, RGB *rgb)
{ int r, g, b;
r = (int)pal[x].r + (int)pal[y].r;
g = (int)pal[x].g + (int)pal[y].g;
b = (int)pal[x].b + (int)pal[y].b;
rgb->r = MIN(r, 63);
rgb->g = MIN(g, 63);
rgb->b = MIN(b, 63);
}
int main ();
.....
PALETTE pal;
COLOR_MAP * color_map;
RGB_MAP * rgb_map;
color_map = (COLOR_MAP *) malloc(sizeof(COLOR_MAP));
create_color_table (color_map, pal, add_blender8, NULL);
.....
I get the compiler error:
converting `void (*)(RGB *, int, int, RGB *)' to
`void (*)(const RGB *, int, int, RGB *)' is a
contravariance violation.
Can any ALLEGRO experts help me on eliminating this error ?
__________________________________
Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.
http://search.yahoo.com
|