|
From: Patel, N. M <Nil...@qu...> - 2004-10-28 14:55:47
|
I came across some code references online, and trying to figure out what = does=20 ' +=3D ' stand for. e.g. firstnamelength +=3D 10; =3F=3F=3F=3F -----Original Message----- =46rom: dev...@li... [mailto:dev...@li...]On Behalf Of dev...@li... Sent: Wednesday, October 27, 2004 11:26 PM To: dev...@li... Subject: Dev-cpp-users digest, Vol 1 #2200 - 1 msg 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: Using Templates & Constructors (Siva Chandra) --__--__-- Message: 1 Date: Tue, 26 Oct 2004 21:36:20 -0700 (PDT) =46rom: Siva Chandra <siv...@ya...> Subject: Re: [Dev-C++] Using Templates & Constructors To: dev...@li... Hello,=20 As we can see the compiler complains about the class definition in the *.cpp file. > \myFolder\myClass.cpp In constructor > `myClass<Type>::myClass(const Type&)': >=20 > 7 \myFolder\myClass.cpp syntax error before `;' > token=20 > \myFolder\Makefile.win [Build Error] [myClass.o] > Error 1=20 And, the complaint is about the way you have created a new myClass object. Firtsly, you have declared a protected member object of type Type in the class declaration and not a pointer to an object of type Type. So I guess the declaration code should be changed to: Type* count; // Declare count as a pointer. Next, even after making such a correction, the way you should go about initialising this object is: count =3D new Type(item); and not as: count =3D new Type item; Even here, the class of type Type should have a logically correct copy constructor. > Lastly, here is my myClass.cpp code: > _____________________ > #include <iostream> > #include "myClass.h" > =20 > template<class Type> > myClass<Type>::myClass(const Type &item) //default > constructor > { > count =3D new Type item; > } Hope this helps, Siva Chandra =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D The contents of this message, together with any attachments, are intended = only for the use of the person(s) to which they are addressed and may = contain confidential and/or privileged information. Further, any medical = information herein is confidential and protected by law. It is unlawful for= = unauthorized persons to use, review, copy, disclose, or disseminate = confidential medical information. If you are not the intended recipient, = immediately advise the sender and delete this message and any attachments. = Any distribution, or copying of this message, or any attachment, is = prohibited. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D |
|
From: Patel, N. M <Nil...@qu...> - 2004-11-01 20:15:35
|
Just wondering does anyone know what this syntax would be used for: Example: start =3D "\002"; =66inish =3D "\026"; I know that it might be a repeat delimiter (\) but now sure how it is used.= = Tried looking online for some help but very vague references.=20 Thanks. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D The contents of this message, together with any attachments, are intended = only for the use of the person(s) to which they are addressed and may = contain confidential and/or privileged information. Further, any medical = information herein is confidential and protected by law. It is unlawful for= = unauthorized persons to use, review, copy, disclose, or disseminate = confidential medical information. If you are not the intended recipient, = immediately advise the sender and delete this message and any attachments. = Any distribution, or copying of this message, or any attachment, is = prohibited. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D |
|
From: Thomas W. <wi...@we...> - 2004-11-02 09:31:55
|
Patel, Nilesh M wrote: > Just wondering does anyone know what this syntax would be used for: > > Example: > > start = "\002"; > finish = "\026"; > > I know that it might be a repeat delimiter (\) but now sure how it is used. Tried looking online for some help but very vague references. > > Thanks. This is the syntax to write ASCII characters directy inside a string. E.g. \097 should be equal to 'a' But how can you use the = operator to Strings in Cpp? -=#=- mfg Thomas |
|
From: Per W. <pw...@ia...> - 2004-11-02 12:40:56
|
Octal specification works fine, but more often hexadecimal is more intuitive, i.e. "\x40" for '@'. What was the question about the = operator? using c strings, = assigns the pointer to a string, to the actual string contents. Using the std::string data type on the lefthand side, = assigns a new c string to the c++ object, i.e. calls the operator= method for the std::string class object. /Per W On Tue, 2 Nov 2004, Thomas Witt wrote: > Patel, Nilesh M wrote: > > Just wondering does anyone know what this syntax would be used for: > > > > Example: > > > > start = "\002"; > > finish = "\026"; > > > > I know that it might be a repeat delimiter (\) but now sure how it is used. Tried looking online for some help but very vague references. > > > > Thanks. > > > This is the syntax to write ASCII characters directy inside a string. > E.g. \097 should be equal to 'a' > > But how can you use the = operator to Strings in Cpp? > > -=#=- > mfg Thomas > > > ------------------------------------------------------- > This SF.Net email is sponsored by: > Sybase ASE Linux Express Edition - download now for FREE > LinuxWorld Reader's Choice Award Winner for best database on Linux. > http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: Rafael C. <rc...@un...> - 2004-10-28 15:39:01
|
> I came across some code references online, and trying to figure out what > does > ' += ' stand for. > > e.g. firstnamelength += 10; > It means firstnamelength = firstnamelength + 10; You can use it with +,-,*,/ and %. See one more example below: "firstnamelength /= 10;" ==> "firstnamelength = firstnamelength / 10;" Rafael |
|
From: <wa...@wa...> - 2004-10-28 16:25:38
|
On 28 Oct 2004 at 12:40, Rafael Charnovscki wrote: > > > I came across some code references online, and trying to figure out > > what does ' += ' stand for. > > > > e.g. firstnamelength += 10; > > > It means > firstnamelength = firstnamelength + 10; > You can use it with +,-,*,/ and %. <headslap> I left out % in my answer. Watson (the pencil neck) Davis |
|
From: Per W. <pw...@ia...> - 2004-10-28 23:56:21
|
You also missed bit and shift operations :) &= |= ^= <<= >>= /Per W On Thu, 28 Oct 2004 wa...@wa... wrote: > On 28 Oct 2004 at 12:40, Rafael Charnovscki wrote: > > > > > > I came across some code references online, and trying to figure out > > > what does ' += ' stand for. > > > > > > e.g. firstnamelength += 10; > > > > > It means > > firstnamelength = firstnamelength + 10; > > You can use it with +,-,*,/ and %. > > <headslap> > > I left out % in my answer. > > Watson (the pencil neck) Davis > > > > ------------------------------------------------------- > This Newsletter Sponsored by: Macrovision > For reliable Linux application installations, use the industry's leading > setup authoring tool, InstallShield X. Learn more and evaluate > today. http://clk.atdmt.com/MSI/go/ins0030000001msi/direct/01/ > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: <wa...@wa...> - 2004-10-29 00:35:36
|
I need something bigger to slap my head with. :) Watson (the pencil neck) Davis On 29 Oct 2004 at 1:55, Per Westermark wrote: > You also missed bit and shift operations :) > &= > |= > ^= > <<= > >>= > > /Per W > > On Thu, 28 Oct 2004 wa...@wa... wrote: > > > On 28 Oct 2004 at 12:40, Rafael Charnovscki wrote: > > > > > > > > > I came across some code references online, and trying to figure > > > > out what does ' += ' stand for. > > > > > > > > e.g. firstnamelength += 10; > > > > > > > It means > > > firstnamelength = firstnamelength + 10; > > > You can use it with +,-,*,/ and %. > > > > <headslap> > > > > I left out % in my answer. > > > > Watson (the pencil neck) Davis > > > > > > > > ------------------------------------------------------- > > This Newsletter Sponsored by: Macrovision > > For reliable Linux application installations, use the industry's > > leading setup authoring tool, InstallShield X. Learn more and > > evaluate today. > > http://clk.atdmt.com/MSI/go/ins0030000001msi/direct/01/ > > _______________________________________________ Dev-cpp-users > > mailing list Dev...@li... TO UNSUBSCRIBE: > > http://www23.brinkster.com/noicys/devcpp/ub.htm > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > > > ------------------------------------------------------- > This Newsletter Sponsored by: Macrovision > For reliable Linux application installations, use the industry's > leading setup authoring tool, InstallShield X. Learn more and evaluate > today. http://clk.atdmt.com/MSI/go/ins0030000001msi/direct/01/ > _______________________________________________ Dev-cpp-users mailing > list Dev...@li... TO UNSUBSCRIBE: > http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |