dev-cpp-users Mailing List for Dev-C++ (Page 661)
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. <no...@ya...> - 2001-10-08 05:09:10
|
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: 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 *. :) 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 understand the points you were making about function=20 > calls versus method calls and how the varying overheads are=20 > minimal. However I wanted to show you that C string versus=20 > stl::string does provide a lot of difference. >=20 > If you take a look at the attached code you will find 4 > different versions of the sort algorithm functions I had=20 > posted earlier. The two original ones using C style strings,=20 > slightly redesiged to not modify the input string, and then=20 > two new version of the same algorithms, using the stl::string=20 > class. If you run the program it will report how long it took=20 > a certain number of iterations of each function. The results=20 > have been quite interesting on my computer, and I assume they=20 > 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 also just sheer bloody mindedness. I haven't=20 > meant to do it to be argumentative, but meerly to illustrate=20 > an issue. Hope you don't mind? I have actualy enjoyed=20 > tinkering around with the program as I haven't had much=20 > opportunity in the past to analyse speeds in programs. There=20 > 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, but it does demonstrate that a person should choose=20 > wisely depending upon the task they will be performing. I=20 > welcome any thoughts you have. >=20 > I will note that the case I have demonstrated isn't of any > import unless working with a very large set of data, when=20 > execution time is critical. Also the string I have supplied=20 > as a test case is one that tries to provide a representative=20 > case for normal use of the algorithms. It is interesting (to > me) how using different input strings changes the results,=20 > 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 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=20 > instances only of the member functions of a template class=20 > which are used and ignores the rest. Thus since the code is=20 > expanded inline in the application you have 0 runtime overhead. >=20 >=20 >=20 >=20 |
|
From: Jason H. <jas...@bt...> - 2001-10-08 02:53:15
|
Hi, In the past the computer magazine PC Plus has provided full versions of = Borland C++ Builder (BCB) up to version 4 Profesional so far. The only = limitation is that you aren't lisenced to distribute programs compiled = on it. There was also an upgrade offer to a fully lisenced version with = it, but that may have finished now. They have also been running a series = of tutorials on using BCB. You can checkout the PC Plus website at = www.pcplus.co.uk - I don't know if the back issues with BCB are still = available, but they have an archive of PDF versions of back issues which = might be interesting to you. Jason. ----- Original Message -----=20 From: Daniel Glenfield=20 To: dev...@li...=20 Sent: Sunday, October 07, 2001 2:12 PM 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? How much is VC++ anyway? How much is Borland's compiler in other = countries? Daniel -------------------------------------------------------------------------= ----- 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: Ioannis V. <no...@ya...> - 2001-10-08 02:02:27
|
Yes, the free compiler is command line and a mess to configure. However i have read somewhere that borland offers a trial version of C+++ Builder for download. The IDE is not like Dev-C++ it has RAD like VB (better than VB). =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 -----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 01:51:05
|
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 01:39:23
|
I think dev-c++ list is &*%#$* up... * Ioannis Vranos * Programming pages: http://www.noicys.f2s.com <http://www.noicys.f2s.com/> * Alternative URL: http://run.to/noicys |
|
From: Ioannis V. <no...@ya...> - 2001-10-08 01:04:31
|
The strange thing is i did not get it together with a previous email i had sent. Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.f2s.com <http://www.noicys.f2s.com/> * Alternative URL: http://run.to/noicys -----Original Message----- From: Vas [mailto:v.v...@bt...] Sent: Monday, October 08, 2001 10:11 AM To: Ioannis Vranos; Dev-C++ Subject: Re: [Dev-C++] Test message Got your test ----- Original Message ----- From: Ioannis Vranos <mailto:no...@ya...> To: Dev-C++ <mailto:dev...@li...> Sent: Sunday, October 07, 2001 3:41 PM Subject: [Dev-C++] Test message Test * Ioannis Vranos * Programming pages: http://www.noicys.f2s.com * Alternative URL: http://run.to/noicys |
|
From: Vas <v.v...@bt...> - 2001-10-08 00:10:05
|
MessageGot your test ----- Original Message -----=20 From: Ioannis Vranos=20 To: Dev-C++=20 Sent: Sunday, October 07, 2001 3:41 PM Subject: [Dev-C++] Test message Test * Ioannis Vranos * Programming pages: http://www.noicys.f2s.com * Alternative URL: http://run.to/noicys |
|
From: Ioannis V. <no...@ya...> - 2001-10-07 23:54:43
|
Test * Ioannis Vranos * Programming pages: http://www.noicys.f2s.com <http://www.noicys.f2s.com/> * Alternative URL: http://run.to/noicys |
|
From: Joseph, B. & E. V. <bl...@ho...> - 2001-10-07 23:04:31
|
I found the answer to my GLUT question in the forum. In case you are = wondering here is what I included: #define GLUT_DISABLE_ATEXIT_HACK=20 #include <windows.h>=20 #include <gl/gl.h>=20 #include <gl/glu.h>=20 #include <gl/glut.h> I don't know what that define means. Also, you *have* to put the = windows.h before the glut.h. Thanks, Blumojo |
|
From: <RPG...@ao...> - 2001-10-07 20:02:35
|
Make sure you have linked to the libraries in the project options. Do this by typing -lglut32 -lopengl32 -lglaux32 -lglu32 Generally you don't need glaux and glut in the same project, so I am not totally sure about the -lgluax option. |
|
From: Kevin W. <ke...@me...> - 2001-10-07 15:43:04
|
I was introduced to Borland C++ Builder when I did an Open University course
last year. A cut-down Version 3 was supplied for the course and it was a
real eye-opener - so much easier than MS VisualC++ but just as powerful. I
am completely converted.
If you imagine Visual Basic combined with the power of C++ ( also, it can
compile Delphi, so you can make use of the huge amount of free code on the
Internet ).
Do not compare it with Dev C++ as they are different animals.
If you are a student you can get the pro version for £69 without docs.
Regards,
Kevin.
----- Original Message -----
From: Daniel Glenfield <sp...@ho...>
To: <dev...@li...>
Sent: Sunday, October 07, 2001 2:12 PM
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 £80 ($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 £80 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?
>
>
>
> How much is VC++ anyway? How much is Borland's compiler in other
countries?
>
>
>
> Daniel
>
>
>
>
> --------------------------------------------------------------------------
------
> 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-07 13:12:19
|
<html><div style='background-color:'><DIV> <P><BR>Ok since I am having problems with writing DirectX8 applications with DEV-C++ I am looking to buy a new compiler.</P> <P>I am told Borland 5.5 is the best. Rather than spend £80 ($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.</P> <P>If I spend £80 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?</P> <P> </P> <P>How much is VC++ anyway? How much is Borland's compiler in other countries?</P> <P> </P> <P>Daniel<BR></P></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: Joseph, B. & E. V. <bl...@ho...> - 2001-10-06 21:26:35
|
Has anyone had any luck using glut with Dev-C++ (or MinGW)? I am trying to go through the simple program in the OpenGL Programming = Guide = (http://ask.ii.uib.no/ebt-bin/nph-dweb/dynaweb/SGI_Developer/OpenGL_PG), = but keep getting a linker error: d:\programming\personal\glut\glutmain.o(.text+0x17):glutmain.cpp: = undefined reference to `__glutInitWithExit@12' d:\programming\personal\glut\glutmain.o(.text+0x3b):glutmain.cpp: = undefined reference to `__glutCreateWindowWithExit@8' d:\programming\personal\glut\glutmain.o(.text+0x67):glutmain.cpp: = undefined reference to `__glutCreateMenuWithExit@8' I have put this line in the "Project Options->Further object files or = linker options" box: -lopengl32 -lglu32 -lglaux -lglut -lglut32 And all of this for inculdes: #include <windows.h> // Header File For Windows #include <gl\gl.h> // Header File For The OpenGL32 Library #include <gl\glu.h> // Header File For The GLu32 Library #include <gl\glaux.h> // Header File For The Glaux Library #include <stdio.h> #include <stdlib.h> #include <gl\glut.h> Thank you! |
|
From: <jor...@wa...> - 2001-10-06 16:32:01
|
Unsubcribe |
|
From: <jsc...@gm...> - 2001-10-06 13:34:17
|
Hello, how can i get text into opengl ?
I am able to draw rectangles by i lac a documantion fpr lines and
texts -
i want to print varibales' values .
any idea - or sample program ?
thanks
On 6 Oct 2001, at 1:29, Ricky Gongora wrote:
> How can I get the apstrings data type to work? I've tried to download d=
ifferent Apstring header files from the internet and tried using each one,=
but none of them work. This is the program i'm trying to create:
>
> #include "apstring.h"
> #include<iostream.h>
>
> int main()
> {
> apstring name, rank;
> char middle_initial;
> int years_of_service;
>
> cout<<"Enter the full name: ";
> getline(cin, name);
> cout<<"Enter the rank (Assistant, Associate, or Full): ";
> cin>>rank;
> cout<<"Enter the number of years of service: ";
> cin>>years_of_service;
> cout<<endl<<endl;
> cout<<"name: "<<name<<endl;
> cout<"Rank: "<<rank<<" Professor"<<endl;
> cout<<"Years of service: "<<years_of_service<<endl;
> return 0;
> }
>
J=FCrgen Schuhmacher
jsc...@gm...
|
|
From: Ricky G. <col...@ya...> - 2001-10-06 06:28:52
|
How can I get the apstrings data type to work? I've tried to download =
different Apstring header files from the internet and tried using each =
one, but none of them work. This is the program i'm trying to create:
#include "apstring.h"
#include<iostream.h>
int main()
{
apstring name, rank;
char middle_initial;
int years_of_service;
cout<<"Enter the full name: ";
getline(cin, name);
cout<<"Enter the rank (Assistant, Associate, or Full): ";
cin>>rank;
cout<<"Enter the number of years of service: ";
cin>>years_of_service;
cout<<endl<<endl;
cout<<"name: "<<name<<endl;
cout<"Rank: "<<rank<<" Professor"<<endl;
cout<<"Years of service: "<<years_of_service<<endl;
return 0;
}
|
|
From: KJK::Hyperion <no...@li...> - 2001-10-05 16:54:36
|
At 12.18 29/09/2001 -0500, you wrote:
>when i globally declare:
>enum Boolean {false, true};
>and compile, an error says that there is a parse error before 'false'.
>however, at school, this does not come up when i compile on their turbo
>c++ compiler.
AFAIK, true and false are already defined in C++ (they aren't in C)
|
|
From: KJK::Hyperion <no...@li...> - 2001-10-05 16:54:22
|
At 21.44 15/09/2001 +0530, you wrote: >I have a Programme installation file with ".rar" extention and the >instruction given is to 'unrar' the same and instal. >Which proramme is used to 'unrar ' the same and where it is available. It's a powerful archiver (one of the strongest, only experimental archivers such as Par and RX can do better) programmed by Eugene Roschal, it's available both in the original barebone text-mode couple of rar/unrar commands (my personal favorite) and in a clean graphical UI (Windows only). Go get it at http://www.rarsoft.com/ |
|
From: Juliet <no...@li...> - 2001-10-05 16:54:14
|
At 18.38 15/09/2001 -0400, you wrote: > This is my first post to this list. My name is Joseph, you can call > me Blumojo (or "blu" or "mojo" for short). Welcome, mojo :) hope you enjoy your stay >I really like Dev-cpp and am thinking of sending a donation if I can get >the following to work. I am working on NeHe's OpenGL tutorials >(<http://nehe.gamedev.net/>http://nehe.gamedev.net/) which are really >good - even for a novice like me, but the code he gave was for Visual >CPP. I have worked through a couple of the problems, but have become >"stumped" on lesson 7 where the compiler has given me: >"implicit declaration of function int free()" C calling convention permits functions with an arbitrary number of parameters, since the parameters push AND pop is done on the caller side. Thus C code doesn't need prototypes for functions defined before they're called in the code. This is fine as long as you don't pass parameters of the wrong type (and if it happens the compiler won't warn you because of the lack of a prototype, you'll discover eventual type mismatches at runtime), and as long as you use the cdecl calling convention, that mangles function names by simply putting a "_" in front of them. Things can go ugly with stdcall convention, it mangles names as "_functionname@stacksize", so if you don't provide a prototype the compiler won't be able to generate the "@stacksize" part, the name will not match, the linking phase will fail, thanks for playing, game over. In short, you (they) forgot to include the file where free() is defined (try stdlib.h or malloc.h) AFAIK, malloc() and free() can be safely considered the best ways to allocate/free memory. On Windows, if you wish, you can use LocalAlloc/LocalFree, they map directly on malloc/free but providing for much more flexibility (initialization with zeros, moveable memory blocks, you can retrieve at any time the size of the buffer through its pointer, etc.), or HeapAlloc/HeapFree to allocate a bare block of heap (dangerous!), HeapCreate to create other heaps than the one allocated by default, or the powerful Virtual* family of functions if you're crazy enough to try to implement your own malloc/free. But, you see, these are very platform-dependent choices. You should be fine with the standard memory management |
|
From: Juliet <no...@li...> - 2001-10-05 16:54:03
|
At 11.01 28/09/2001 -0400, you wrote: >I am new to Dev-C++. Sometimes I get "Out of Memory" errors when I try to >close windows in a project. Want my access violations in exchange of your out-of-memory's? :P The fact is, as I said before, that Dev-C++ source code is a bit, uh, messy. Privileging eye candy (see the l33t title bars and k3wL toolbars - no offense intended :P) over clean code. After I'm done with my current project, I'll have a closer look at the sources, (try to) clean them, debug them, etc. |
|
From: andreas o. <an...@ph...> - 2001-10-05 12:28:06
|
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 |
|
From: A.V.Maheswara R. <ven...@wi...> - 2001-10-05 09:55:38
|
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-05 09:42:01
|
I forgot to mention that i have started myself with C too and that except from the previous benefits of the templates (inline expansion=3D0 runtime overhead, instances only of the member functions which are used=3D0 space overhead) the fact that not using the string type and its member functions and using C strings and passing them as arguments among functions "twiddling their bits" has almost always as a result the programmer to write a lot more code than that getting compiled when you use the string type. Also the cost of calling a stand alone function is usually bigger than the cost of calling a member function. Add to this that the templates are usually expanded inline and the fact that a good compiler always creates code only for those template functions used, and you will understand why C++ programs performed better than their equivallent C programs in http://www.research.att.com/~bs/esc99.html Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.f2s.com * Alternative URL: http://run.to/noicys > -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf=20 > Of Jason Hardman > Sent: Friday, October 05, 2001 3:32 AM > To: Dev-C++ > Subject: Re: [Dev-C++] Help with functions |
|
From: Ioannis V. <no...@ya...> - 2001-10-05 04:44:17
|
> -----Original Message----- > From: dev...@li...=20 > [mailto:dev...@li...] On Behalf=20 > Of Jason Hardman > Sent: Friday, October 05, 2001 3:32 AM > To: Dev-C++ > Subject: Re: [Dev-C++] Help with functions >=20 >=20 > Thanks for pointing out the casting. The only reason I did it=20 > was because I had had to look up the functions and had=20 > noticed the type differences, and I figured it's best to cast=20 > rather than use implicit casting. As for using C style casts=20 > instead of C++, just call me a lazy typer. Using=20 > static_cast<unsigned> is twice as much to type. :) Yes but the C style casting is equivallent with reinterpret_cast the most unsafe casting. C++ style casts are as restrictive as possible for a particular situation and must be used instead of the C cast. It is ugly in writing because you *very rarely* have to use casts, and casts may hide potential errors. Much usage of casts in C++ is an indication of bad code. In a few words, you should almost never need casting in normal C++ applications. >=20 > As for sizeof(), it was just the first thing that came to my=20 > head at the time, and as you said it was a const string . As=20 > for using the a C string as opposed to a C++ string=20 > container, that was deliberate. For the task I was performing=20 > I decided that a C string was more efficient than the=20 > alternative, and converting from a string container isn't=20 > hard. I tend to write my C++ programs as more of a hybrid=20 > C/C++ style, as I did learn C first then expanded from it to C++. The notion that the C subset is fastest than C++ is a myth. See http://www.research.att.com/~bs/esc99.html and http://www.research.att.com/~bs/crc.pdf C++ string is a typedef of basic_string<char> type that is: typedef basic_string<char> string; basic_string is a template class and template classes tend to expanded inline when compiled. Also a good compiler creates instances only of the member functions of a template class which are used and ignores the rest. Thus since the code is expanded inline in the application you have 0 runtime overhead. >=20 > The reason that I had written the sort algorithm was because=20 > someone had asked how to do it. As is my habit I went=20 > overkill on it. I really like taking on problems like that,=20 > although I probably should have let the person figure it out=20 > for himself. Looking at my sortv2 algorithm I think I may=20 > have given him a headache. :-D While I'm no expert on the=20 > standard algorithm's sorting fuctions, I think they mainly=20 > cover sorting into literal order, and not sorting same=20 > letters in to the order they appear in sequence, grouping=20 > them together (skipping spaces), i.e. MISSISSIPPI MUD to=20 > MMIIIISSSSPPUD. I am currently studying C++ myself too and i haven;t reached at the algorithms chapters but as far as i know C++ sorting algorithms can be provided with the rules of how to sort (here the number of appearances of the letters). Also i think they are template functions too so they are expanded inline as i mentioned above. >=20 > Jason. Keep coding :) Ioannis * Ioannis Vranos * Programming pages: http://www.noicys.f2s.com * Alternative URL: http://run.to/noicys |
|
From: Jason H. <jas...@bt...> - 2001-10-05 01:32:20
|
Thanks for pointing out the casting. The only reason I did it was because I
had had to look up the functions and had noticed the type differences, and I
figured it's best to cast rather than use implicit casting. As for using C
style casts instead of C++, just call me a lazy typer. Using
static_cast<unsigned> is twice as much to type. :)
As for sizeof(), it was just the first thing that came to my head at the
time, and as you said it was a const string . As for using the a C string as
opposed to a C++ string container, that was deliberate. For the task I was
performing I decided that a C string was more efficient than the
alternative, and converting from a string container isn't hard. I tend to
write my C++ programs as more of a hybrid C/C++ style, as I did learn C
first then expanded from it to C++.
The reason that I had written the sort algorithm was because someone had
asked how to do it. As is my habit I went overkill on it. I really like
taking on problems like that, although I probably should have let the person
figure it out for himself. Looking at my sortv2 algorithm I think I may have
given him a headache. :-D While I'm no expert on the standard algorithm's
sorting fuctions, I think they mainly cover sorting into literal order, and
not sorting same letters in to the order they appear in sequence, grouping
them together (skipping spaces), i.e. MISSISSIPPI MUD to MMIIIISSSSPPUD.
Jason.
> srand((unsigned) time(NULL)); // give the rand() function a seed
> // I use the time because it's not likely to be the same each
> time
> // the program is run. There may be a better way of doing
> this?
There is no need for casting since it returns always positive values,
and -1 only in case of error. The conversion is a regular built in
conversion from an integer type to an unsigned integer type. Also
casting a negative number to an unsigned type has the same truncation
effects as the direct assignment without casting. Also in case of
casting always try to use the C++ style casts and not the C style cast.
> // Getting a character out of a string
> char a_string[] = "This is a string of text. Hello World!";
> cout << a_string << endl << "Enter a number between 1 and "
> << sizeof(a_string) - 1 << ": ";
> // the string is null terminated, so sizeof reports one
> bigger
> // than text
sizeof() always works for arrays declared locally or globally (and not
passed as a pointer argument to a function). So be careful with it, and
in case of char pointer arguments to function us strlen(p)+1 style; Also
always try to use C++ string type than C-style string type.
> cin >> num;
> cout << "The character at that number is: " << a_string[num-1] <<
> endl;
> // You don't need a function to get a single character out of
> a string
> // just use array access. This applies to std::string too.
> // don't forget... arrays are indexed from 0
>
> cout << endl;
>
> // Sorting a string in sequence
C++ provides enough sorting algorithms, try using one of them (probably
C++ sort() ).
> char str[80], str2[80]; // up to 80 chars
> cout << "Enter a string to be sorted in sequence (80 char MAX!)"
> << endl << ": ";
> gets(str); // get a string from user (part of <cstdio>)
> strcpy(str2, str); // make a copy
>
> // Begin sort (brute force)
> int i = 0, j = 0, k = 0; // index's
> char sorted[80], c;
> while(str[i])
> {
> while(str[i] == ' ') ++i; // skip spaces
> if(!str[i]) break; // avoid end of line
> j = i;
> c = str[i];
> while(str[j])
> {
> if(str[j] == c)
> {
> sorted[k] = c;
> str[j] = ' '; // don't get the same char twice
> ++k; // increment sorted index
> }
> ++j; // increment search index
> }
> ++i; // increment input index
> }
> sorted[k] = 0; // don't forget to null terminate string!
> cout << "Sorted string is: " << sorted << endl;
> // NB: there may be a better way to do it, but this works and
> you
> // don't really need anything faster for just 80 chars.
> // I leave it to you to perform size and type checking
> anywhere
>
> sortv2(str2); // I made a faster one anyway :)
> cout << "Sorted by V2 is : " << str2 << endl;
>
> system("PAUSE");
> return 0;
> }
>
>
> // another sort that should be faster (in theory)
> // for one it uses pointer arithmatic mainly which is faster // than
> array access, secondly it employs two single passes // of the string,
> rather than the multiple in the other version // one thing you could
> note is that if you give this function // an already sorted string it
> will take longer than the v1 sort // method. void sortv2(char str[])
> // pass it the string to be sorted {
> char ts[80], *pstr, *pts;
> int count[128], *pc;
> pc = count;
> for(int i = 0; i < 128; ++i) *pc++ = 0; // clear all of
> count to zero
> pstr = str;
> while(*pstr) ++count[*pstr++]; // count instances of each
> character
> pstr = str;
> pts = ts;
> while(*pstr)
> {
> while(*pstr == ' ') ++pstr; // ignore spaces
> if(!*pstr) break; // stop at EOL
> for(; count[*pstr]; --count[*pstr])
> *pts++ = *pstr;
> ++pstr;
> }
> *pts = 0; // NULL terminate
> strcpy(str, ts); // copy it over original string
>
> }
>
>
> _______________________________________________
> Dev-cpp-users mailing list Dev...@li...
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>
Ioannis
* Ioannis Vranos
* Programming pages: http://www.noicys.f2s.com
* Alternative URL: http://run.to/noicys
_______________________________________________
Dev-cpp-users mailing list
Dev...@li...
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|