dev-cpp-users Mailing List for Dev-C++ (Page 660)
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: Mansoor N. <man...@sy...> - 2001-10-10 23:23:04
|
Hi, this is an extract of a problem directly given to me by my teacher, without an explanation. Any help solving it would be greatly appreciated. Mansoor: Structured Sums Problem Using in order only the digits 3 through 7 to form numbers, and the operations + and - to combine those numbers, find all possible combinations totalling a given value. Each digit may be used only once in forming the numbers. For example, if the total were to be 25, your program should find these two possibilities: +3+4+5+6+7 +3-45+67 Your program should ask for the desired total, and then list those combinations (if any) yielding that total. |
|
From: Jason S. <mys...@op...> - 2001-10-10 21:57:52
|
g_pMenuFont is a pointer of/to the type CD3Dfont, g_pCurrentMenu is a pointer of/to the type CMenuItem, and both are pointing to null. In case the positioning of the asterick was confusing you, you can have the asterick next to the data type, in between, or next to the declared variable, though I usually just leave it next to the pointer. (e.g. if you had char c, *p=&c; you obviously wouldn't want the asterick next to char there, so for simplicities sake I just always do it that.) Jason ----- Original Message ----- From: Daniel Glenfield To: dev...@li... Sent: Wednesday, October 10, 2001 5:14 PM Subject: [Dev-C++] what does this mean? The bit I'm confused about is the asterisks(*). In the example below, CD3DFont* and CMenuItem* aren't pointers are they? Are g_pMenuFont and g_pCurrentMenu pointers? Please help lol CD3DFont* g_pMenuFont = NULL; CMenuItem* g_pCurrentMenu = NULL; ------------------------------------------------------------------------------ Get your FREE download of MSN Explorer at http://explorer.msn.com _______________________________________________ Dev-cpp-users mailing list Dev...@li... https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
|
From: Daniel G. <sp...@ho...> - 2001-10-10 21:15:22
|
<html><div style='background-color:'><DIV> <DIV> <DIV>The bit I'm confused about is the asterisks(*). In the example below, CD3DFont* and CMenuItem* aren't pointers are they? Are g_pMenuFont and g_pCurrentMenu pointers?</DIV> <DIV> </DIV> <DIV>Please help lol</DIV> <DIV> </DIV> <DIV>CD3DFont* g_pMenuFont = NULL; </DIV> <DIV>CMenuItem* g_pCurrentMenu = NULL;</DIV></DIV></DIV></div><br clear=all><hr>Get your FREE download of MSN Explorer at <a href='http://go.msn.com/bql/hmtag_itl_EN.asp'>http://explorer.msn.com</a><br></html> |
|
From: Jason H. <jas...@bt...> - 2001-10-10 20:53:16
|
According to the Win32 API reference it is in the <mmsystem.h> header, =
so you need to at least make sure that is included in main.cpp =
somewhere.
Jason.
----- Original Message -----=20
From: Stein Nyg=E5rd=20
To: DevCpp=20
Sent: Wednesday, October 10, 2001 9:03 PM
Subject: [Dev-C++] HELP!
When I use;
PlaySound("NIMclick.wav", NULL, SND_SYNC);
DevCpp says;
140 main.cpp - implicit declaration of function `int PlaySound(...)'
I have no idea what to do! I once got help with this problem, but I =
have lost all my sourcefiles and therefor I'm totally lost. Please help =
somone :)
Thanks, Stein
|
|
From: Ioannis V. <no...@ya...> - 2001-10-10 20:16:54
|
This means that there is no definition or declaration of PlaySound in scope and compiler makes assumptions. In a few words you have not #include the proper header file (if one exists). =20 =20 =20 Ioannis =20 * Ioannis Vranos * Programming pages: http://www.noicys.f2s.com <http://www.noicys.f2s.com/>=20 * Alternative URL: http://run.to/noicys -----Original Message----- From: dev...@li... [mailto:dev...@li...] On Behalf Of Stein Nyg=E5rd Sent: Wednesday, October 10, 2001 10:04 PM To: DevCpp Subject: [Dev-C++] HELP! When I use; PlaySound("NIMclick.wav", NULL, SND_SYNC); DevCpp says; 140 main.cpp - implicit declaration of function `int PlaySound(...)' =20 I have no idea what to do! I once got help with this problem, but I have lost all my sourcefiles and therefor I'm totally lost. Please help somone :) =20 Thanks, Stein |
|
From: <ste...@ge...> - 2001-10-10 20:09:06
|
When I use;
PlaySound("NIMclick.wav", NULL, SND_SYNC);
DevCpp says;
140 main.cpp - implicit declaration of function `int PlaySound(...)'
I have no idea what to do! I once got help with this problem, but I have =
lost all my sourcefiles and therefor I'm totally lost. Please help =
somone :)
Thanks, Stein
|
|
From: <ste...@ge...> - 2001-10-10 20:06:23
|
When I use;
PlaySound("NIMclick.wav", NULL, SND_SYNC);
DevCpp says;
140 main.cpp - implicit declaration of function `int PlaySound(...)'
I have no idea what to do! I once got help with this problem, but I have =
lost all my sourcefiles and therefor I'm totally lost. Please help =
somone :)
Thanks, Stein
|
|
From: Daniel G. <sp...@ho...> - 2001-10-10 17:40:09
|
<html><div style='background-color:'><DIV> <P>Dev-C++ comes with a load of libraries and headers, but you can get the ones for directX8 at <A href="http://www.gamecoding.co.uk">www.gamecoding.co.uk</A> , though I found that I had to go get Microsoft Visual C++ for doing anything more than basic directx work.</P> <P>Loads of info is at <A href="http://msdn.microsoft.com/">http://msdn.microsoft.com/</A> so there's plenty there to keep you occupied.</P> <P> </P> <P>Daniel<BR><BR></P></DIV> <DIV></DIV> <DIV></DIV>>From: carlos GARCÍA DEL MONTE <CG...@WO...> <DIV></DIV>>To: dev...@li... <DIV></DIV>>Subject: [Dev-C++] About libraries and header files <DIV></DIV>>Date: Wed, 10 Oct 2001 18:26:12 +0200 <DIV></DIV>> <DIV></DIV>>Is there some site where i can found headers and libraries for <DIV></DIV>>download?, and are there others where i can find an explanation of the <DIV></DIV>>headers which exist? <DIV></DIV>> <DIV></DIV>> <DIV></DIV>>_______________________________________________ <DIV></DIV>>Dev-cpp-users mailing list <DIV></DIV>>Dev...@li... <DIV></DIV>>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users <DIV></DIV></div><br clear=all><hr>Get your FREE download of MSN Explorer at <a href='http://go.msn.com/bql/hmtag_itl_EN.asp'>http://explorer.msn.com</a><br></html> |
|
From: carlos D. M. <cg...@wo...> - 2001-10-10 16:32:20
|
Is there some site where i can found headers and libraries for download?, and are there others where i can find an explanation of the headers which exist? |
|
From: Nurhidayat <dh...@ma...> - 2001-10-09 08:34:57
|
At 08:54 PM 10/8/01 +0200, you wrote: > hi, I'd like to use the command getch in dev-cpp. Is this implemented >oe do I have to add a specific header file?? Reply to >dan...@co... #include <conio.h> // or conio_mingw.h ___Nurhidayat___ |
|
From: <Kai...@me...> - 2001-10-08 21:16:54
|
Ich werde ab 04.10.2001 nicht im B=FCro sein. Ich kehre zur=FCck am 10.10.2001. Aus gesundheitlichen Gr=FCnden bin ich bis einschlie=DFlich 10.10.01 ni= cht im B=FCro.= |
|
From: <mi...@ju...> - 2001-10-08 20:11:35
|
For those having trouble, here's how I got it to work: a.) I put both apstring.h and apstring.cpp in the include folder. I referred to it as follows #include<apstring.cpp> Hope this helps! |
|
From: ffffgggrf <dgr...@vt...> - 2001-10-08 18:51:07
|
hi, I'd like to use the command getch in dev-cpp. Is this implemented oe do I have to add a specific header file?? Reply to dan...@co... |
|
From: <ste...@ge...> - 2001-10-08 17:47:48
|
Please... can someone tell me how to make my opengl-apps work as a = screensaver. Like, I would like them to be named stuff like somethin.scr = and so that one could choose them in the windows screensaver settings. I = really would aprreciate some help on this. Oh, and I also have another problem... where is PlaySound(); defined? Thanks alot, Stein |
|
From: andreas o. <an...@ph...> - 2001-10-08 13:17:44
|
Hi, does anyone know where to find the wxWindows packages for DevC++? I was having a look at [ http://members.fortunecity.com/honglilai/wxwindows.html ] but apart from the demos zip file I keep getting 404s when trying to download. Thanks for your help, Andreas -- andreas otto - an...@ph... Using php on windows? http://www.php4win.de _______________________________________________ Dev-cpp-users mailing list Dev...@li... https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
|
From: Ioannis V. <no...@ya...> - 2001-10-08 08:03:48
|
People sorry for my today double postings this is definately not my day. I guess my pop3 account had some problems (or the list) but now anything works ok. =20 =20 Ioannis =20 * Ioannis Vranos * Programming pages: http://www.noicys.f2s.com <http://www.noicys.f2s.com/>=20 * Alternative URL: http://run.to/noicys =20 |
|
From: Ioannis V. <no...@ya...> - 2001-10-08 07:58:36
|
People sorry for the reposting but i made some important expression mistakes. It is great you are interested for the reality of the things. :) At first your code had some errors (for 100% ansi standard) and omitions (you forgot #include <iostream> for example) which i fixed. I did not dare to see your code and think how exactly your algorithm work but the results showed the C++ versions to be slower than C's. I attach you your code fixed as old.cpp. I wrote my code using the standard library sorting function thus applying the same algorithm to both stuff. The code is attached as=20 temp.cpp. The results are: C:\c>temp begin: 1992 cend: 24515 cppend: 47017 char * sorting time: 22523 std::string sorting time: 22502 As you see the string sorting time here is smaller than char *. :) In less elements the opposite happened. In both situations the difference is small. In worse case scenario C++ code must function at the same speed as C's code. And this because C++ was designed for 0 space and time overhead. Also as i said you before when you do not use string and use char pointers you end up using more code than those provided by built in member functions(=3Dspace overhead). Also you end up with time overhead! And this because function calls are more expensive than member function calls, and especially in a good compiler where template member functions are inlined. So in practice using C++ mechanisms is far better than using C's because of the less head aches, clearer code, more bug free code (you can end up copying things after the end of a char array for example, but not in a string), less code, far easier maintainability and probably better speed! As i told before take also a look at:=20 http://www.research.att.com/~bs/esc99.html The reason that your code produces big differences is obviously bugs. The algorithms aren't applied fairly the same at both worlds, e.t.c.. Also i am glad to discuss with you these matters. I am waiting fro your reply on the issue. I am sending my reply in the list because there are others who will benefit from this discussion. :) Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.f2s.com * Alternative URL: http://run.to/noicys > -----Original Message----- > From: Jason Hardman [mailto:jas...@bt...] > Sent: Monday, October 08, 2001 4:44 AM > To: Ioannis Vranos > Subject: Re: [Dev-C++] Help with functions >=20 >=20 > Hi again, >=20 > I know this is an old issue but I wanted to demonstrate a point. I=20 > understand the points you were making about function calls versus=20 > method calls and how the varying overheads are minimal. However I=20 > wanted to show you that C string versus stl::string does provide a lot > of difference. >=20 > If you take a look at the attached code you will find 4 different=20 > versions of the sort algorithm functions I had posted earlier. The two > original ones using C style strings, slightly redesiged to not modify=20 > the input string, and then two new version of the same algorithms,=20 > using the stl::string class. If you run the program it will report how > long it took a certain number of iterations of each function. The=20 > results have been quite interesting on my computer, and I assume they > will be similar on yours. I recomend that you run it with and=20 > without compiler optimisations switched on. The compiler I=20 > use is MinGW, so I don't know how other compilers will=20 > perform, but I don't think the results will change a great=20 > deal in others. Be prepared to wait a bit, my computer is a=20 > PIII 750 and the whole program when fully optimised takes=20 > about 20 secs, unoptimised is much longer. >=20 > The reason I have done this is out of an interest in such things, and=20 > also just sheer bloody mindedness. I haven't meant to do it to be=20 > argumentative, but meerly to illustrate an issue. Hope you don't mind? > I have actualy enjoyed tinkering around with the program as I haven't=20 > had much opportunity in the past to analyse speeds in programs. There > are probably a few more optimisations I could introduce,=20 > especially in both V1 functions, mainly by using pointers and=20 > iterators respectivly. >=20 > This doesn't mean that I recomend C strings over stl::string objects,=20 > but it does demonstrate that a person should choose wisely depending=20 > upon the task they will be performing. I welcome any thoughts you=20 > have. >=20 > I will note that the case I have demonstrated isn't of any import=20 > unless working with a very large set of data, when execution time is=20 > critical. Also the string I have supplied as a test case is one that=20 > tries to provide a representative case for normal use of the=20 > algorithms. It is interesting (to > me) how using different input strings changes the results, > mainly when comparing the two algorithms. Try strings of=20 > differing lengths, and vary how unsorted the strings are,=20 > i.e. give it a string that doesn't need any sorting. >=20 > Thanx for putting up with me, Jason. >=20 > ----- Original Message ----- > From: "Ioannis Vranos" <no...@ya...> > To: "Dev-C++" <dev...@li...> > Sent: Friday, October 05, 2001 6:45 AM > Subject: RE: [Dev-C++] Help with functions >=20 > The notion that the C subset is fastest than C++ is a myth. See=20 > http://www.research.att.com/~bs/esc99.html and=20 > http://www.research.att.com/~bs/crc.pdf >=20 > C++ string is a > typedef of basic_string<char> type that is: >=20 > typedef basic_string<char> string; >=20 > basic_string is a template class and template classes tend to expanded > inline when compiled. Also a good compiler creates instances only of=20 > the member functions of a template class which are used and ignores=20 > the rest. Thus since the code is expanded inline in the application=20 > you have 0 runtime overhead. >=20 >=20 >=20 >=20 |
|
From: <pe...@ce...> - 2001-10-08 06:15:51
|
unsubcribe |
|
From: Pere <psa...@te...> - 2001-10-08 06:14:34
|
unsubcribe ----- Original Message -----=20 From: Jorge Garcia-Donas K=FCbler=20 To: Dev...@li...=20 Sent: Saturday, October 06, 2001 6:31 PM Subject: [Dev-C++] Unsubcribe Unsubcribe |
|
From: Pere <psa...@te...> - 2001-10-08 06:13:27
|
unsubcribe ----- Original Message -----=20 From: Jorge Garcia-Donas K=FCbler=20 To: Dev...@li...=20 Sent: Saturday, October 06, 2001 6:31 PM Subject: [Dev-C++] Unsubcribe Unsubcribe |
|
From: A.V.Maheswara R. <ven...@wi...> - 2001-10-08 05:47:13
|
The Information contained and transmitted by this E-MAIL is proprietary to Wipro and/or its Customer and is intended for use only by the individual or entity to which it is addressed, and may contain information that is privileged, confidential or exempt from disclosure under applicable law. If this is a forwarded message, the content of this E-MAIL may not have been sent with the authority of the Company. If you are not the intended recipient, an agent of the intended recipient or a person responsible for delivering the information to the named recipient, you are notified that any use, distribution, transmission, printing, copying or dissemination of this information in any way or in any manner is strictly prohibited. If you have received this communication in error, please delete this mail & notify us immediately at mai...@wi... |
|
From: Ioannis V. <no...@ya...> - 2001-10-08 05:28:53
|
Here is the link for the free trial of Borland C++ Builder 5 download. Also, if you receive this message please send me a reply telling so, since it seems something wrong with the list goes on (at least for me). =20 http://www.borland.com/bcppbuilder/trial5/trialdownload.html =20 =20 Friendly, Ioannis =20 * Ioannis Vranos * Programming pages: http://www.noicys.f2s.com <http://www.noicys.f2s.com/>=20 * Alternative URL: http://run.to/noicys =20 -----Original Message----- From: dev...@li... [mailto:dev...@li...] On Behalf Of Daniel Glenfield Sent: Sunday, October 07, 2001 3:12 PM To: dev...@li... Subject: [Dev-C++] Which compiler is best?(AGAIN) Ok since I am having problems with writing DirectX8 applications with DEV-C++ I am looking to buy a new compiler. I am told Borland 5.5 is the best. Rather than spend =A380 ($130) on it = I decided to download Borland's 5.5 free version, which I found to be a complete waste of time as it's so hard to get it to compile ANYTHING. If I spend =A380 on the Borland C++ Builder 5 Standard version am I = going to have a load of problems, or is it just like DEV-C++ but works better? =20 How much is VC++ anyway? How much is Borland's compiler in other countries? =20 Daniel _____ =20 Get your FREE download of MSN Explorer at http://explorer.msn.com <http://go.msn.com/bql/hmtag_itl_EN.asp>=20 _______________________________________________ Dev-cpp-users mailing list Dev...@li... https://lists.sourceforge.net/lists/listinfo/dev-cpp-users=20 |
|
From: Ioannis V. <no...@ya...> - 2001-10-08 05:28:05
|
Does anyone know how can i identify the active tcp/ip connections of my machine using win32 api? To be more accurate i want to identify the ip addresses my pc is connected to from the various applications and be able to read the data transmitted from any application.=20 =20 I would be grateful for any help! =20 =20 Friendly, Ioannis =20 * Ioannis Vranos * Programming pages: http://www.noicys.f2s.com <http://www.noicys.f2s.com/>=20 * Alternative URL: http://run.to/noicys =20 |
|
From: Ioannis V. <no...@ya...> - 2001-10-08 05:16:47
|
People sorry for the reposting but i made some important expression mistakes. It is great you are interested for the reality of the things. :) At first your code had some errors (for 100% ansi standard) and omitions (you forgot #include <iostream> for example) which i fixed. I did not dare to see your code and think how exactly your algorithm work but the results showed the C++ versions to be slower than C's. I attach you your code fixed as old.cpp. I wrote my code using the standard library sorting function thus applying the same algorithm to both stuff. The code is attached as=20 temp.cpp. The results are: C:\c>temp begin: 1992 cend: 24515 cppend: 47017 char * sorting time: 22523 std::string sorting time: 22502 As you see the string sorting time here is smaller than char *. :) In less elements the opposite happened. In both situations the difference is small. In worse case scenario C++ code must function at the same speed as C's code. And this because C++ was designed for 0 space and time overhead. Also as i said you before when you do not use string and use char pointers you end up using more code than those provided by built in member functions(=3Dspace overhead). Also you end up with time overhead! And this because function calls are more expensive than member function calls, and especially in a good compiler where template member functions are inlined. So in practice using C++ mechanisms is far better than using C's because of the less head aches, clearer code, more bug free code (you can end up copying things after the end of a char array for example, but not in a string), less code, far easier maintainability and probably better speed! As i told before take also a look at:=20 http://www.research.att.com/~bs/esc99.html The reason that your code produces big differences is obviously bugs. The algorithms aren't applied fairly the same at both worlds, e.t.c.. Also i am glad to discuss with you these matters. I am waiting fro your reply on the issue. I am sending my reply in the list because there are others who will benefit from this discussion. :) Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.f2s.com * Alternative URL: http://run.to/noicys > -----Original Message----- > From: Jason Hardman [mailto:jas...@bt...] > Sent: Monday, October 08, 2001 4:44 AM > To: Ioannis Vranos > Subject: Re: [Dev-C++] Help with functions >=20 >=20 > Hi again, >=20 > I know this is an old issue but I wanted to demonstrate a point. I=20 > understand the points you were making about function calls versus=20 > method calls and how the varying overheads are minimal. However I=20 > wanted to show you that C string versus stl::string does provide a lot > of difference. >=20 > If you take a look at the attached code you will find 4 different=20 > versions of the sort algorithm functions I had posted earlier. The two > original ones using C style strings, slightly redesiged to not modify=20 > the input string, and then two new version of the same algorithms,=20 > using the stl::string class. If you run the program it will report how > long it took a certain number of iterations of each function. The=20 > results have been quite interesting on my computer, and I assume they > will be similar on yours. I recomend that you run it with and=20 > without compiler optimisations switched on. The compiler I=20 > use is MinGW, so I don't know how other compilers will=20 > perform, but I don't think the results will change a great=20 > deal in others. Be prepared to wait a bit, my computer is a=20 > PIII 750 and the whole program when fully optimised takes=20 > about 20 secs, unoptimised is much longer. >=20 > The reason I have done this is out of an interest in such things, and=20 > also just sheer bloody mindedness. I haven't meant to do it to be=20 > argumentative, but meerly to illustrate an issue. Hope you don't mind? > I have actualy enjoyed tinkering around with the program as I haven't=20 > had much opportunity in the past to analyse speeds in programs. There > are probably a few more optimisations I could introduce,=20 > especially in both V1 functions, mainly by using pointers and=20 > iterators respectivly. >=20 > This doesn't mean that I recomend C strings over stl::string objects,=20 > but it does demonstrate that a person should choose wisely depending=20 > upon the task they will be performing. I welcome any thoughts you=20 > have. >=20 > I will note that the case I have demonstrated isn't of any import=20 > unless working with a very large set of data, when execution time is=20 > critical. Also the string I have supplied as a test case is one that=20 > tries to provide a representative case for normal use of the=20 > algorithms. It is interesting (to > me) how using different input strings changes the results, > mainly when comparing the two algorithms. Try strings of=20 > differing lengths, and vary how unsorted the strings are,=20 > i.e. give it a string that doesn't need any sorting. >=20 > Thanx for putting up with me, Jason. >=20 > ----- Original Message ----- > From: "Ioannis Vranos" <no...@ya...> > To: "Dev-C++" <dev...@li...> > Sent: Friday, October 05, 2001 6:45 AM > Subject: RE: [Dev-C++] Help with functions >=20 > The notion that the C subset is fastest than C++ is a myth. See=20 > http://www.research.att.com/~bs/esc99.html and=20 > http://www.research.att.com/~bs/crc.pdf >=20 > C++ string is a > typedef of basic_string<char> type that is: >=20 > typedef basic_string<char> string; >=20 > basic_string is a template class and template classes tend to expanded > inline when compiled. Also a good compiler creates instances only of=20 > the member functions of a template class which are used and ignores=20 > the rest. Thus since the code is expanded inline in the application=20 > you have 0 runtime overhead. >=20 >=20 >=20 >=20 |
|
From: Ioannis V. <no...@ya...> - 2001-10-08 05:12:54
|
> -----Original Message----- > From: Ioannis Vranos [mailto:no...@ya...] > Sent: Monday, October 08, 2001 8:11 AM > To: Dev-C++ (dev...@li...) > Subject: C versus C++ > > > It is great you are interested for the reality of the things. > :) At first your code had some errors (for 100% ansi > standard) and omitions (you forgot #include <iostream> for > example) which i fixed. I did not dare to see your code and > think how exactly your algorithm work but the results showed > the C++ versions to be slower than C's. > > I attach you your code fixed as old.cpp. > > I wrote my code using the standard library sorting function > thus applying the same algorithm to both stuff. The code is > attached as > temp.cpp. > > The results are: > > C:\c>temp > begin: 2002 cend: 24885 cppend: 47558 > > char * sorting speed: 22883 std::string sorting speed: 22673 > > As you see the string speed here is smaller than char *. :) I made an expression mistake, these are timings and here string is *faster* than char *. Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.f2s.com * Alternative URL: http://run.to/noicys |