dev-cpp-users Mailing List for Dev-C++ (Page 387)
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: Defiant H. <he...@er...> - 2003-05-05 07:53:01
|
I've heard that "C: The Complete Reference" isn't a very good manual. I haven't read it, myself, but someone far more knowledgeable than I has. Here is his partial list of errata for the book: http://www.seebs.net/c/c_tcr.html I would recommend "The C Programming Language" (K&R2), myself. I've been reading that recently, and it seems to be an excellent reference. David Matthews wrote: > Personally, I found "C: The Complete Reference" a wonderful starting > book. > I first learned how to program in C from that book, then I turned to a > few > others to fill in the gaps. |
|
From: Ioannis V. <iv...@at...> - 2003-05-05 07:42:53
|
He has bad fame of telling wrong things! In any case for book reviews you can check http://www.accu.org/ which provides reliable reviews. You can check what they say about the book you are mentioning. Regards, Ioannis Vranos * Programming pages: http://www.noicys.freeurl.com * Alternative URL 1: http://run.to/noicys * Alternative URL 2: http://www.noicys.cjb.net > -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of David Matthews > Sent: Sunday, May 04, 2003 7:44 PM > To: Ioannis Vranos; dev...@li... > Subject: RE: [Dev-C++] RES: Dev-cpp-users digest, Vol 1 #1433 - 3 msgs > > > Personally, I found "C: The Complete Reference" a wonderful > starting book. > I first learned how to program in C from that book, then I > turned to a few > others to fill in the gaps. |
|
From: Christian S. <sm...@xs...> - 2003-05-05 05:10:03
|
Hi, I'm wondering if I can use Dev C++ to write BSD licensed software and if I can use it to write closed source commercial software. I'm asking because DevCPP is licensed GPL. Thanks Smurf |
|
From: <h.r...@gm...> - 2003-05-05 01:16:09
|
Please, no html mail. I never open such mails. Thanks -- Horst Rößner Postf. 1802 52205 Stolberg ICQ ID #74808448 h.r...@gm... h.g...@t-... +++ GMX - Mail, Messaging & more http://www.gmx.net +++ Bitte lächeln! Fotogalerie online mit GMX ohne eigene Homepage! |
|
From: David M. <dem...@uw...> - 2003-05-05 01:03:54
|
Personally, I found "C: The Complete Reference" a wonderful starting book. I first learned how to program in C from that book, then I turned to a few others to fill in the gaps. At 09:27 AM 04/05/2003 +0300, Ioannis Vranos wrote: >> -----Original Message----- >> From: dev...@li... >> [mailto:dev...@li...] On Behalf >> Of Mark Livingstone >> Sent: Saturday, May 03, 2003 9:46 AM >> To: dev...@li... >> Subject: Re: [Dev-C++] RES: Dev-cpp-users digest, Vol 1 #1433 - 3 msgs >> >> >> On Mon, 28 Apr 2003 15:25:17 -0400 >> David Matthews <dem...@uw...> wrote: >> >> > If the Herbert Schildt book is the spanish version of "C: >> The Complete >> > Reference" then there's a much newer version from 2000. >> >> Long ago when BBSes were all the rage and the Internet was >> not available >> to common man :-), Suggesting in C_ECHO a Herb Schildt book >> was frowned >> upon because the C Guru's who reviewed the books he >> (copiously) produced >> had the common opinion that Schildt know zero about programming C that >> was worth passing on. >> >> Has this changed in the last 5-10 years? > > >No! Still his books are popular. :( > > > >Ioannis Vranos > >* Programming pages: http://www.noicys.freeurl.com >* Alternative URL 1: http://run.to/noicys >* Alternative URL 2: http://www.noicys.cjb.net > > > > >------------------------------------------------------- >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...@at...> - 2003-05-04 18:16:10
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of OROSZI Bal?zs > Sent: Sunday, May 04, 2003 7:46 PM > To: dev...@li... > Subject: Re: [Dev-C++] classes and references > > > > I shall say that I will have a good knowledge of C++ after > I have finished > > the book inclduing the appendices. :) > > No. Then you will have absolute knowledge. A C++ guru in > other words. :) Ah yes. Well it is my style to state that I know something when I know it completely... All the people that I know behave differently. :) Ioannis Vranos * Programming pages: http://www.noicys.freeurl.com * Alternative URL 1: http://run.to/noicys * Alternative URL 2: http://www.noicys.cjb.net |
|
From: <or...@vp...> - 2003-05-04 16:46:32
|
Ioannis Vranos wrote: > But he explicitly mentions that the 3 first chapters are a quick tour of the > language and he explicitly mentions that everything will become clear later. > The learning process begins from chapter 4. For example: templates are first *used* in the 3rd chapter (___*****and from then continuously*****___, i.e. in the 4th and 5th and so on) and described in the 12th... This caused me a lot of headache, he used it a lot of times, and I had absolutely no idea what hell is vector<xxx> for example... > I do not like it too, but it is what it takes to become a good programmer. > That said you do not need to know all the features provided by C++ to do > programs, but it takes years to learn it all (assuming you also have other > things to do daily). Well, that is called _experience_. I think it is way different from knowing, what a code part from another project does... > I shall say that I will have a good knowledge of C++ after I have finished > the book inclduing the appendices. :) No. Then you will have absolute knowledge. A C++ guru in other words. :) > Well it is aimed towards itermediate programmers. However my belief is that > every programmmer of C++ should have read this book. Yes, *should have*... -- Greets, Balázs |
|
From: Per W. <pw...@ia...> - 2003-05-04 15:42:05
|
I wouldn't recoment the use of a vector for the players - unless you expect the number of players to be constant for the lifetime of the program. It's better to use a list or similar. Your code will be simpler if you Select a container where the container iterator doesn't change when you insert/remove players (unless of course you remove the player that the iterator points to :-) Thread pools are used when you want quick response to new requests, while some operations are very slow. Either perform all operations through a thread pools, or just send out the expensive work. A thread pool is a number of threads blocking while they wait for a work unit to be delivered to them through a queue or similar. As soon as a thread gets something to do, it performs the action, taking its time. Then it releases the work object (player (?) maybe in this case) and starts listening on the work queue again. By using mutexes, semaphores or similar, the threads will not consume any time while waiting for work to do. The main program thread may pick up new player actions while the work threads performs all the grimy stuff. If it is important that all players gets the same number of 'actions' done and the main program gets back to a player that hasn't been released by the thread pool, the main thread might possibly block until the extra work is done. Normally, the thread pool should have had quite some time to perform the heavy stuff so for the majority of times, no blocking will occur. wxWindows has a lot of nice encapsulations for threads, database access, etc if you want to make the server - or the clients - portable to different oprating systems and platforms. /Per W On Sun, 4 May 2003, David McKen wrote: > > ----- Original Message ----- > From: "Ioannis Vranos" <iv...@at...> > To: <ci...@ya...> > Sent: Sunday, May 04, 2003 2:33 AM > Subject: RE: [Dev-C++] 'extern const' and std::vector > > > > > -----Original Message----- > > > From: David McKen [mailto:ci...@ya...] > > > Sent: Sunday, May 04, 2003 3:53 AM > > > To: Ioannis Vranos > > > Subject: Re: [Dev-C++] 'extern const' and std::vector > > > > > > > > > I must say thnk you to those who helped me. > > > > > > At firs ti have to note that you sent the email only to > me. I guess you > made > > this by mistake? :) > > > > Whoops my bad.. > > > > > > > > Istill have one question thoug about using a pool of > > > threads for a 'round > > > robin' approach. How would I implement such a system? > My > > > current idea is > > > that all the player objects will be in a vector and I > have > > > an int pointing > > > to the one that has been most recently processed. Once > a > > > thread is avalible > > > it reads this varible and moves on to the next object > in > > > the vector > > > (starting at the begining if it has reached the end), > > > updating the integer > > > so the next thread knows which object to process? Any > > > suggestions (or better > > > yet some example code) would be appreciated. > > > > > > > > I do not know thread magic (yet)... > > > > > > > BTW Ioannis we plan to make it multi-OS the library we > are > > > using is Opentop. > > > Unfortunately our goal to become truly os-independent > is > > > proving harder than > > > we thought. If push comes to shove we will stick with > the > > > *NIX and Win32 > > > (none of us on the developement team have a Mac to > > > playaround with). > > > > > > > > Why don't you use OpenGL, isn't it portable? > > > > This is the server we are talking about. Opentop does not > provide any > graphics classes. > The server is purely textbased. We hope to make a client > that will be > graphical (For that > we can use OpenGL).Opentop provides wrappers for various > things (threads, > sockets, etc). > > > > > My sugggestion is do not use Win32, use .NET instead. > > > > > > > > > > Ioannis Vranos > > > > * Programming pages: http://www.noicys.freeurl.com > > * Alternative URL 1: http://run.to/noicys > > * Alternative URL 2: http://www.noicys.cjb.net > > > > > > > __________________________________________________ > 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: David M. <ci...@ya...> - 2003-05-04 15:20:36
|
----- Original Message ----- From: "Ioannis Vranos" <iv...@at...> To: <ci...@ya...> Sent: Sunday, May 04, 2003 2:33 AM Subject: RE: [Dev-C++] 'extern const' and std::vector > > -----Original Message----- > > From: David McKen [mailto:ci...@ya...] > > Sent: Sunday, May 04, 2003 3:53 AM > > To: Ioannis Vranos > > Subject: Re: [Dev-C++] 'extern const' and std::vector > > > > > > I must say thnk you to those who helped me. > > > At firs ti have to note that you sent the email only to me. I guess you made > this by mistake? :) > Whoops my bad.. > > > > Istill have one question thoug about using a pool of > > threads for a 'round > > robin' approach. How would I implement such a system? My > > current idea is > > that all the player objects will be in a vector and I have > > an int pointing > > to the one that has been most recently processed. Once a > > thread is avalible > > it reads this varible and moves on to the next object in > > the vector > > (starting at the begining if it has reached the end), > > updating the integer > > so the next thread knows which object to process? Any > > suggestions (or better > > yet some example code) would be appreciated. > > > > I do not know thread magic (yet)... > > > > BTW Ioannis we plan to make it multi-OS the library we are > > using is Opentop. > > Unfortunately our goal to become truly os-independent is > > proving harder than > > we thought. If push comes to shove we will stick with the > > *NIX and Win32 > > (none of us on the developement team have a Mac to > > playaround with). > > > > Why don't you use OpenGL, isn't it portable? > This is the server we are talking about. Opentop does not provide any graphics classes. The server is purely textbased. We hope to make a client that will be graphical (For that we can use OpenGL).Opentop provides wrappers for various things (threads, sockets, etc). > > My sugggestion is do not use Win32, use .NET instead. > > > > > Ioannis Vranos > > * Programming pages: http://www.noicys.freeurl.com > * Alternative URL 1: http://run.to/noicys > * Alternative URL 2: http://www.noicys.cjb.net > > __________________________________________________ Do you Yahoo!? The New Yahoo! Search - Faster. Easier. Bingo http://search.yahoo.com |
|
From: Nancy A. <nai...@ho...> - 2003-05-04 13:47:42
|
<html><div style='background-color:'><DIV> <DIV>Hi </DIV> <DIV> </DIV> <DIV>I want use debug. What do you have to get it. </DIV> <DIV> </DIV> <DIV> </DIV></DIV></div><br clear=all><hr>Charla con tus amigos en línea mediante MSN Messenger: <a href="http://g.msn.com/8HMWES/2728">Haz clic aquí</a> </html> |
|
From: Ioannis V. <iv...@at...> - 2003-05-04 13:30:42
|
> -----Original Message----- > From: dev...@li...=20 > [mailto:dev...@li...] On Behalf=20 > Of OROSZI Bal?zs > Sent: Sunday, May 04, 2003 10:58 AM > To: dev...@li... > Subject: Re: [Dev-C++] classes and references >=20 >=20 >=20 > I don't want to argue about this, but I have *exact*=20 > examples. The book=20 > places stuff in the place, where they absolutely don't belong. > For example: templates are first *used* in the 3rd chapter (and from=20 > then continuously) and described in the 12th... But he explicitly mentions that the 3 first chapters are a quick tour of = the language and he explicitly mentions that everything will become clear = later. The learning process begins from chapter 4. =20 > Trust me, learning C++ in 5 days is no easy task. > I don't have years... and I don't need years. I do not like it too, but it is what it takes to become a good = programmer. That said you do not need to know all the features provided by C++ to = do programs, but it takes years to learn it all (assuming you also have = other things to do daily). > I think I am already doing well - I understand *all* of the=20 > const things=20 > now, the static stuff, classes, inheritance, overloading=20 > (operator and=20 > function), templates, exceptions, references etc. I'm a fast=20 > learner :) >=20 > Oh, and about random - reading from page 1 to 400 fast or not fast is=20 > not random. ;) >=20 > So, I think I have a good knowledge of C++ now, so questions=20 > are welcome=20 > - but still expect some from me. I shall say that I will have a good knowledge of C++ after I have = finished the book inclduing the appendices. :) =20 > P.S.: BTW, I have TC++PLSE (Special Edition) - and it is not=20 > meant for=20 > programmers of C++ - it is meant for starter C++ programmers. Well it is aimed towards itermediate programmers. However my belief is = that every programmmer of C++ should have read this book. Regards, Ioannis Vranos =20 * Programming pages: http://www.noicys.freeurl.com * Alternative URL 1: http://run.to/noicys * Alternative URL 2: http://www.noicys.cjb.net |
|
From: <or...@vp...> - 2003-05-04 07:58:06
|
Ioannis Vranos wrote: > TC++PL3 is meant to be read by C++ programmers who know the basics and > sequencially, that is from cover to cover. Not in random order. For example > how can you understand the implementations of the standard containers if you > haven't finished the chapter about templates. Each page must be read > thoroughly and the whole process will take years. > > Apparently you tried to read it in a fast/random fashion. I don't want to argue about this, but I have *exact* examples. The book places stuff in the place, where they absolutely don't belong. For example: templates are first *used* in the 3rd chapter (and from then continuously) and described in the 12th... Trust me, learning C++ in 5 days is no easy task. I don't have years... and I don't need years. I think I am already doing well - I understand *all* of the const things now, the static stuff, classes, inheritance, overloading (operator and function), templates, exceptions, references etc. I'm a fast learner :) Oh, and about random - reading from page 1 to 400 fast or not fast is not random. ;) So, I think I have a good knowledge of C++ now, so questions are welcome - but still expect some from me. > Because as BS says in the book you can't pass a reference to a temporary > object, but you can pass a const reference. That's what I said, no? ;) -- Greets, Balázs P.S.: BTW, I have TC++PLSE (Special Edition) - and it is not meant for programmers of C++ - it is meant for starter C++ programmers. |
|
From: Ioannis V. <iv...@at...> - 2003-05-04 06:28:04
|
> -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf > Of Mark Livingstone > Sent: Saturday, May 03, 2003 9:46 AM > To: dev...@li... > Subject: Re: [Dev-C++] RES: Dev-cpp-users digest, Vol 1 #1433 - 3 msgs > > > On Mon, 28 Apr 2003 15:25:17 -0400 > David Matthews <dem...@uw...> wrote: > > > If the Herbert Schildt book is the spanish version of "C: > The Complete > > Reference" then there's a much newer version from 2000. > > Long ago when BBSes were all the rage and the Internet was > not available > to common man :-), Suggesting in C_ECHO a Herb Schildt book > was frowned > upon because the C Guru's who reviewed the books he > (copiously) produced > had the common opinion that Schildt know zero about programming C that > was worth passing on. > > Has this changed in the last 5-10 years? No! Still his books are popular. :( Ioannis Vranos * Programming pages: http://www.noicys.freeurl.com * Alternative URL 1: http://run.to/noicys * Alternative URL 2: http://www.noicys.cjb.net |
|
From: Ioannis V. <iv...@at...> - 2003-05-04 06:26:05
|
> -----Original Message-----
> From: dev...@li...=20
> [mailto:dev...@li...] On Behalf=20
> Of OROSZI Bal?zs
> Sent: Sunday, May 04, 2003 1:17 AM
> To: Dev...@li...
> Subject: [Dev-C++] classes and references
>=20
>=20
> Hi!
>=20
> Please, C++ gurus out there - help me, I think I'm gonna get=20
> crazy soon.
>=20
> Finally I have decided to learn C++. 400 pages so far from Bjarne's=20
> book. I can tell - it is a whole bunch of crap. I'm sure Bjarne can=20
> desing C++ programs very well, but he cannot design a book,=20
> that's sure.=20
> You just cannot find the thing that you need at the right=20
> place, it is=20
> spread across 1600 pages. Find it - well thanks a lot :)
TC++PL3 is meant to be read by C++ programmers who know the basics and
sequencially, that is from cover to cover. Not in random order. For =
example
how can you understand the implementations of the standard containers if =
you
haven't finished the chapter about templates. Each page must be read
thoroughly and the whole process will take years.
Apparently you tried to read it in a fast/random fashion.
>=20
> So, to the point. I have a question about a thing, that works with=20
> Borland, and MSVC, but not with g++. Here it is:
>=20
> I have a class, name it "myclass".
> I have a function, which return "myclass".
> I have a function, which uses "myclass".
> Here they are:
>=20
> //The class
> class myclass{
> public:
> static void use_myclass(myclass& mc){ //The using function
> printf("Value: %d\n",mc.value);
> }
> int value;
> };
>=20
> //The returner function
> myclass make_myclass(void)
> {
> myclass mc_tmp;
> return mc_tmp;
> }
>=20
> And so why the hell doesn't this work?:
>=20
> int main()
> {
> myclass::use_myclass(make_myclass());
> return 0;
> }
>=20
> WHILE THIS DOES:
>=20
> int main()
> {
> myclass mc_tmp =3D make_myclass();
> myclass::use_myclass(mc_tmp);
> return 0;
> }
>=20
> The ONLY difference is, that I put the result in a temporary=20
> variable,=20
> then I used that.
> The compiler gave this warning to the first one:
>=20
> test.cpp:19: no matching function for call to=20
> `myclass::use_myclass(myclass)'
> test.cpp:5: candidates are: static void myclass::use_myclass(myclass&)
>=20
> So why the hell doesn't it make a reference from it then???
>=20
> Please help me with this, I am at the bounds of getting=20
> crazy... really!
Because as BS says in the book you can't pass a reference to a temporary
object, but you can pass a const reference.
Ioannis Vranos
=20
* Programming pages: http://www.noicys.freeurl.com
* Alternative URL 1: http://run.to/noicys
* Alternative URL 2: http://www.noicys.cjb.net
|
|
From: Goran K. <go...@re...> - 2003-05-04 00:29:38
|
V ned, 04.05.2003 ob 01:46, je OROSZI Bal=E1zs poslal(a): > Goran Kavrecic wrote: > > try defining your return type as a reference with a simple and(&) aft= er the class name. > tried it, and it gives a warning: "reference returned to local variable= "=20 I think I've got with BC something like "...return valuse used as temporary value" or at least it sounds alike. > I am pondering, it has something to do with const stuff. >=20 > (... 5 mins trial ...) >=20 > BINGO!!! >=20 > YIPEE!!! I have also found the explanation in the book!!! :))) > The book sais (rough translation): At the end the book isn't so stupid, a? > And again, thanks for you swift response. Welcome. Obvously we are stronger when united. Good night, Goran |
|
From: Mark L. <mli...@ip...> - 2003-05-04 00:16:37
|
On Mon, 28 Apr 2003 15:25:17 -0400 David Matthews <dem...@uw...> wrote: > If the Herbert Schildt book is the spanish version of "C: The Complete > Reference" then there's a much newer version from 2000. Long ago when BBSes were all the rage and the Internet was not available to common man :-), Suggesting in C_ECHO a Herb Schildt book was frowned upon because the C Guru's who reviewed the books he (copiously) produced had the common opinion that Schildt know zero about programming C that was worth passing on. Has this changed in the last 5-10 years? |
|
From: <or...@vp...> - 2003-05-03 23:46:42
|
Goran Kavrecic wrote:
> try defining your return type as a reference with a simple and(&) after the class name.
>
> myclass& make_myclass(void)
> {
> myclass mc_tmp;
> return mc_tmp;
> }
Well, of course, but this sounds too simple. Besides I have already
tried it, and it gives a warning: "reference returned to local variable"
or something.
I am pondering, it has something to do with const stuff.
(... 5 mins trial ...)
BINGO!!!
I have changed the use_myclass function to this:
static void use_myclass(const myclass& mc){
printf("Value: %d\n",mc.value);
}
and it worked!
(... 5 mins reading ...)
YIPEE!!! I have also found the explanation in the book!!! :)))
So: when I call
use_myclass(make_myclass());
then make_myclass() will return with a local variable, thus causing the
copy constructor to get called. It will make a copy and place into a
TEMPORARY variable, then pass THAT for use_myclass()
The book sais (rough translation):
"We may use a temporary variable to initialize a constant."
BUT "... a temporary variable *cannot* be used to initialize a
non-constant reference"
So this is why I didn't work. It tried to initialise the parameter of
use_myclass(myclass&) (a reference) with a TEMPORARY variable. This is
illegal.
MSVC and BORLAND *_SUCKS_*!!! They support hacks!!! >:(
My, thank you pal. You drived my attention to the right part! Thanks,
really! :)
Oh, BTW one should *never* return a reference to a local variable. That
is written in the book, and it is also understandable. Because it will
be deleted, before it could be used.
Well, I got cleverer. I think I will be able to handle C++ well. So,
questions are welcome, least I will look it up, so I will learn too.
And again, thanks for you swift response.
--
Greetings,
Balázs
|
|
From: Goran K. <go...@re...> - 2003-05-03 22:52:55
|
> So why the hell doesn't it make a reference from it then???
>=20
try defining your return type as a reference with a simple and(&) after t=
he class name.
myclass& make_myclass(void)
{
myclass mc_tmp;
return mc_tmp;
}
regards,
goran
V ned, 04.05.2003 ob 00:17, je OROSZI Bal=E1zs poslal(a):
> Hi!
>=20
> Please, C++ gurus out there - help me, I think I'm gonna get crazy soon.
>=20
> Finally I have decided to learn C++. 400 pages so far from Bjarne's=20
> book. I can tell - it is a whole bunch of crap. I'm sure Bjarne can=20
> desing C++ programs very well, but he cannot design a book, that's sure=
.=20
> You just cannot find the thing that you need at the right place, it is=20
> spread across 1600 pages. Find it - well thanks a lot :)
>=20
> So, to the point. I have a question about a thing, that works with=20
> Borland, and MSVC, but not with g++. Here it is:
>=20
> I have a class, name it "myclass".
> I have a function, which return "myclass".
> I have a function, which uses "myclass".
> Here they are:
>=20
> //The class
> class myclass{
> public:
> static void use_myclass(myclass& mc){ //The using function
> printf("Value: %d\n",mc.value);
> }
> int value;
> };
>=20
> //The returner function
> myclass make_myclass(void)
> {
> myclass mc_tmp;
> return mc_tmp;
> }
>=20
> And so why the hell doesn't this work?:
>=20
> int main()
> {
> myclass::use_myclass(make_myclass());
> return 0;
> }
>=20
> WHILE THIS DOES:
>=20
> int main()
> {
> myclass mc_tmp =3D make_myclass();
> myclass::use_myclass(mc_tmp);
> return 0;
> }
>=20
> The ONLY difference is, that I put the result in a temporary variable,=20
> then I used that.
> The compiler gave this warning to the first one:
>=20
> test.cpp:19: no matching function for call to=20
> `myclass::use_myclass(myclass)'
> test.cpp:5: candidates are: static void myclass::use_myclass(myclass&)
>=20
> So why the hell doesn't it make a reference from it then???
>=20
> Please help me with this, I am at the bounds of getting crazy... really=
!
>=20
> Thank you!
>=20
> --
> Greetings,
> Bal=E1zs
>=20
>=20
>=20
> -------------------------------------------------------
> 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
>=20
|
|
From: <or...@vp...> - 2003-05-03 22:17:19
|
Hi!
Please, C++ gurus out there - help me, I think I'm gonna get crazy soon.
Finally I have decided to learn C++. 400 pages so far from Bjarne's
book. I can tell - it is a whole bunch of crap. I'm sure Bjarne can
desing C++ programs very well, but he cannot design a book, that's sure.
You just cannot find the thing that you need at the right place, it is
spread across 1600 pages. Find it - well thanks a lot :)
So, to the point. I have a question about a thing, that works with
Borland, and MSVC, but not with g++. Here it is:
I have a class, name it "myclass".
I have a function, which return "myclass".
I have a function, which uses "myclass".
Here they are:
//The class
class myclass{
public:
static void use_myclass(myclass& mc){ //The using function
printf("Value: %d\n",mc.value);
}
int value;
};
//The returner function
myclass make_myclass(void)
{
myclass mc_tmp;
return mc_tmp;
}
And so why the hell doesn't this work?:
int main()
{
myclass::use_myclass(make_myclass());
return 0;
}
WHILE THIS DOES:
int main()
{
myclass mc_tmp = make_myclass();
myclass::use_myclass(mc_tmp);
return 0;
}
The ONLY difference is, that I put the result in a temporary variable,
then I used that.
The compiler gave this warning to the first one:
test.cpp:19: no matching function for call to
`myclass::use_myclass(myclass)'
test.cpp:5: candidates are: static void myclass::use_myclass(myclass&)
So why the hell doesn't it make a reference from it then???
Please help me with this, I am at the bounds of getting crazy... really!
Thank you!
--
Greetings,
Balázs
|
|
From: phantom u. <sil...@ho...> - 2003-05-03 20:54:17
|
_________________________________________________________________ Charla con tus amigos en línea mediante MSN Messenger: http://messenger.yupimsn.com/ |
|
From: Astar <As...@tu...> - 2003-05-03 10:32:43
|
Hello Jared,
Saturday, May 3, 2003, 6:56:03 AM, you wrote:
JH> hello I'm new to programming and am having problems when it comes to compiling and running my programs im using code from a book and when I select compile and run it doesn't work no error message
JH> nothing it simply does nothing is there something I'm doing wrong or something I can do to resolve this issue your help is greatly appreciated thanks again
JH> -Twitch
i think that your program work with console, and your program finish
its work faster than you can saw it. If i'm right try to add
next command at the end of program:
system("PAUSE");
PS. english.... english... sorry :))
--
Best regards,
Astar mailto:As...@tu...
|
|
From: Yeoh H. <ye...@ye...> - 2003-05-03 09:11:43
|
Hi, One method is to use the Static Control, in particular: <extract from MSDN> Image Static Control An image static control can display bitmaps, icons (including animated icons), or enhanced metafiles. The type of graphic that a particular static control displays depends on the control's style: SS_BITMAP, SS_ICON, or SS_ENHMETAFILE. An application specifies the style when it creates the control and also specifies a handle to the bitmap, icon, or metafile for the control to display. After the control is created, an application can associate a different graphic with the control by sending it an STM_SETIMAGE message, specifying a handle to the new graphic object. An application can retrieve a handle to the graphic object currently associated with a static control by sending it an STM_GETIMAGE message. An application sends messages to a static control by using the SendDlgItemMessage function. </extract from MSDN> Another method is to use GDI. IMHO, this is more flexible. You can display any image type any where. Regards, Yeoh http://www.yeohhs.com ----- Original Message ----- From: "Ioannis Vranos" <iv...@em...> To: "Dev-C++ Mailing List" <dev...@li...> Sent: Saturday, May 03, 2003 6:55 AM Subject: [Dev-C++] Stand alone image on a form > If I want to add staand alone images on a form (not part of a toolbar or > something), is there some control specific for that or I have to use GDI > only? > > > > > > Regards, > > Ioannis Vranos > > * Programming pages: http://www.noicys.freeurl.com > * Alternative URL 1: http://run.to/noicys > * Alternative URL 2: http://www.noicys.cjb.net > > > > > ------------------------------------------------------- > 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: <Har...@ne...> - 2003-05-03 05:13:37
|
dev...@li... wrote: >Send Dev-cpp-users mailing list submissions to > dev...@li... > >To subscribe or unsubscribe via the World Wide Web, visit > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users >or, via email, send a message with subject or body 'help' to > dev...@li... > >You can reach the person managing the list at > dev...@li... > >When replying, please edit your Subject line so it is more specific >than "Re: Contents of Dev-cpp-users digest..." > > >Today's Topics: > > 1. RE: C and C++ sintax restrictions in Dev-C++ (Ioannis Vranos) > 2. Re: two-dimensional arrays (Daniel Glenfield) > >--__--__-- > >Message: 1 >From: "Ioannis Vranos" <iv...@at...> >To: "Dev-C++ Mailing List" <dev...@li...> >Date: Sun, 27 Apr 2003 03:19:38 +0300 >Subject: RE: [Dev-C++] C and C++ sintax restrictions in Dev-C++ > >> -----Original Message----- >> From: dev...@li... >> [mailto:dev...@li...] On Behalf >> Of Andrι Macαrio Barros >> Sent: Saturday, April 26, 2003 8:54 PM >> To: Dev-Cpp-Users >> Subject: [Dev-C++] C and C++ sintax restrictions in Dev-C++ >> >> >> Dear Users, >> >> ---> Some students are using a mix of commands and features like: >> /* and // >> getchar() and cin.get() >> <stdio.h> and <iostream> >> <stdlib.h> and <cstdlib> >> printf and cout >> scanf and cin >> .c and .cpp >> >> "A"---> I´ve tried some enable/disabe options inside >> "Options->Compiler Options->C/C++ Compiler", >> but couldn´t >> inhibt the students to write codes mixing the commands. > > >Of course you couldn't since they belong to the C subset of C++ (that is >they are valid C++). > > > >> The corrections are still by hand. Sometimes is >> difficult >> to explain for some guys that come with vicious >> what a C or >> a C++ program is. >> >> ---> My Questions: >> 1) Is my attempt to convince them correct? > > >If you say to them that printf() is not C++ then you are wrong. What you >must say is that C++ provides newer facilities which are superior >alternatives. > > > >> 2) If it is, is there any set of options that allows me to >> inhibt to mix >> C and C++ features? > > >No because it is C++. You haven't any mixture of the 2 languages. Personally >I wouldn't mark it as wrong since it is not. > > > > > >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 > > > > >--__--__-- > >Message: 2 >From: "Daniel Glenfield" <sp...@ho...> >To: pio...@wp..., dev...@li... >Subject: Re: [Dev-C++] two-dimensional arrays >Date: Sun, 27 Apr 2003 01:58:32 +0100 > >Try two nested for loops, like > >for (condition relating to [x][]) > > // then > for (condition relating to second dimension [][x]) > >So you end up with >[0][0] to [0][9] (or whatever) then you come out of the inner for loop. Then >control goes to the outer loop and then goes back into the second to do >[1][0] to [1][9] > > > > >>From: Piotrus Student <pio...@wp...> >>Reply-To: Piotrus Student <pio...@wp...> >>To: dev...@li... >>Subject: [Dev-C++] two-dimensional arrays >>Date: Sun, 27 Apr 2003 01:40:40 +0200 >> >>Hello >> >>Could somebody help me to solve the following problem? >>I have to swap two two-dimensional arrays. I wouldn't like to do it in >>this way: >> >>... >>double vec_1[N][M],vec_2[N][M],temp; >>int i,j; >>... >>for(i=0;i<N;i++) >> for(j=0;j<M;j++) >> { >> temp=vec_1[i][j]; >> vec_1[i][j]=vec_2[i][j]; >> vec_2[i][j]=temp; >> } >>... >> >> >>Thanks for advance. Peter. >> >> >> >> >>------------------------------------------------------- >>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 > > >_________________________________________________________________ >Overloaded with spam? With MSN 8, you can filter it out >http://join.msn.com/?page=features/junkmail&pgmarket=en-gb&XAPID=32&DI=1059 > > > > >--__--__-- > >_______________________________________________ >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 > > >End of Dev-cpp-users Digest > __________________________________________________________________ Try AOL and get 1045 hours FREE for 45 days! http://free.aol.com/tryaolfree/index.adp?375380 Get AOL Instant Messenger 5.1 for FREE! Download Now! http://aim.aol.com/aimnew/Aim/register.adp?promo=380455 |
|
From: Ioannis V. <iv...@at...> - 2003-05-03 05:04:47
|
You are not mentioning which version of Borland compiler. If you mean turbo c or something, then the compiler of Dev-C++ (which is MINGW) is more ISO C and ISO C++ compliant. Another thing is that it's = free. If you are using Win32, then free is a serious advantage (along with = high standards compliance).=20 Now if you were using VCL/CLX, naturally C++ Builder has advantages. 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 -----Original Message----- From: dev...@li... [mailto:dev...@li...] On Behalf Of Lists Sent: Saturday, May 03, 2003 7:20 AM To: C++ List Subject: [Dev-C++] Compiler question Hello, I've taken a break from programming and now that I'm getting back into = it I want to make sure I do it right, with the right equipment. Can anyone = tell me the benefit of using Dev-C++ over the Borland compiler I used in the past? Tvienti |
|
From: Jared H. <the...@ms...> - 2003-05-03 04:22:42
|
hello I'm new to programming and am having problems when it comes to =
compiling and running my programs im using code from a book and when I =
select compile and run it doesn't work no error message nothing it =
simply does nothing is there something I'm doing wrong or something I =
can do to resolve this issue your help is greatly appreciated thanks =
again
-Twitch |