From helenatroy1@hotmail.com Thu Mar 22 14:46:59 2007 From: helenatroy1@hotmail.com (Helena Troy) Date: Thu, 22 Mar 2007 13:46:59 +0000 Subject: [Stk] bloodshed dev C++ (and sstream.h) In-Reply-To: <43DE6191.4030907@blueyonder.co.uk> Message-ID: Hello I'm trying to figure out how to compile example 1 from the tutorials using a default bloodshed dev c++ project. (dev c++ doesn't recognize .dsw files) Stk.h includes , but I couldn't find 'sstream.h' anywhere on my hard drive - neither in the stk include files nor in my bloodshed include files. I grabbed a copy of sstream.h off the internet - & now I'm chasing down all kinds of crazy includes. Is there an sstream.h that should be used with the STK that I can get from the stk site? (If there is, I don't know where to find it) _________________________________________________________________ 5.5%* 30 year fixed mortgage rate. Good credit refinance. Up to 5 free quotes - *Terms https://www2.nextag.com/goto.jsp?product=100000035&url=%2fst.jsp&tm=y&search=mortgage_text_links_88_h2a5d&s=4056&p=5117&disc=y&vers=910 From gewang@CS.Princeton.EDU Fri Mar 23 05:40:56 2007 From: gewang@CS.Princeton.EDU (Ge Wang) Date: Fri, 23 Mar 2007 00:40:56 -0400 (EDT) Subject: [Stk] bloodshed dev C++ (and sstream.h) In-Reply-To: References: Message-ID: Hi! > I'm trying to figure out how to compile example 1 from the tutorials > using a default bloodshed dev c++ project. (dev c++ doesn't recognize > .dsw files) Stk.h includes , but I couldn't find 'sstream.h' > anywhere on my hard drive - neither in the stk include files nor in my > bloodshed include files. I believe refers to the Standard C++ Library header, which on many systems do not have a ".h" extension (I believe sstream.h and its predecessor strstream.h are now deprecated). ANSI-compliant C++ compilers should come standard with sstream. If your version of Bloodshed Dev C++ can't locate , you may need to update. In fact, a google search led to this hint: "In previous versions of Dev-C++, the included compiler did not implement sstream. Fortunately, new versions of Dev-C++ do not have this problem. Upgrade to the latest version of Dev-C++." I hope this helps. Best, Ge! From josep.comajuncosas@wanadoo.es Sat Mar 24 11:32:27 2007 From: josep.comajuncosas@wanadoo.es (Josep M Comajuncosas) Date: Sat, 24 Mar 2007 11:32:27 +0100 Subject: [Stk] newbie question Message-ID: <200703241032.l2OAWZN08995@cm-mail.stanford.edu> This is a multi-part message in MIME format. ------=_NextPart_000_0033_01C76E08.1A6F1630 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi, just an , I guess, idiomatic question about the Stk library. Say I use one of the generator classes SineWave sine; sine.setFrequency(...) I don't see where is the SineWave instance err..instanced, like SineWave sine = new SineWave(); as those are not class methods but instance methods. Is the sine constructed just by declaring it? Am I lost somewhere? Thanks in advance... Josep M ------=_NextPart_000_0033_01C76E08.1A6F1630 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
Hi,
just = an , I guess,=20 idiomatic question about the Stk library.
Say I = use one of the=20 generator classes
 
SineWave=20 sine;
sine.setFrequency(...)
 
I = don't see where is=20 the SineWave instance err..instanced, like
 
SineWave sine =3D new=20 SineWave();
 
as = those are not=20 class methods but instance methods. Is the sine constructed just by = declaring=20 it?
Am I = lost=20 somewhere?
 
Thanks = in=20 advance...
Josep=20 M
------=_NextPart_000_0033_01C76E08.1A6F1630-- From mchinen@gmail.com Sat Mar 24 17:09:49 2007 From: mchinen@gmail.com (Michael Chinen) Date: Sun, 25 Mar 2007 01:09:49 +0900 Subject: [Stk] newbie question In-Reply-To: <200703241032.l2OAWZN08995@cm-mail.stanford.edu> References: <200703241032.l2OAWZN08995@cm-mail.stanford.edu> Message-ID: Hi Josep, STK is written for C++, so objects will be allocated when their variables are declared. SineWave sine; will allocate and call the SineWave() constructor for the sine variable behind the scenes. You are of thinking of Java or C#, perhaps, where objects are all pointers. If you want to do newing, you will need to explicitly declare the variable a pointer, such as SineWave* sine = new SineWave(); sine->setFrequency(..); HTH Michael On 3/24/07, Josep M Comajuncosas wrote: > > > Hi, > just an , I guess, idiomatic question about the Stk library. > Say I use one of the generator classes > > SineWave sine; > sine.setFrequency(...) > > I don't see where is the SineWave instance err..instanced, like > > SineWave sine = new SineWave(); > > as those are not class methods but instance methods. Is the sine constructed > just by declaring it? > Am I lost somewhere? > > Thanks in advance... > Josep M From prc@CS.Princeton.EDU Sat Mar 24 17:44:49 2007 From: prc@CS.Princeton.EDU (Perry R Cook) Date: Sat, 24 Mar 2007 12:44:49 -0400 (EDT) Subject: [Stk] newbie question In-Reply-To: References: <200703241032.l2OAWZN08995@cm-mail.stanford.edu> Message-ID: Josep, Michael is right on. You need to use the pointer form if you want to call a constructor that takes arguments. A class may have more than one constructor, a default without arguments, which is automagically called when you declare an instance of it, and others which might take arguments. PRC On Sun, 25 Mar 2007, Michael Chinen wrote: > Hi Josep, > > STK is written for C++, so objects will be allocated when their > variables are declared. > > SineWave sine; > > will allocate and call the SineWave() constructor for the sine > variable behind the scenes. > > You are of thinking of Java or C#, perhaps, where objects are all pointers. > If you want to do newing, you will need to explicitly declare the > variable a pointer, such as > > SineWave* sine = new SineWave(); > sine->setFrequency(..); > > HTH > > Michael > > > > On 3/24/07, Josep M Comajuncosas wrote: >> >> >> Hi, >> just an , I guess, idiomatic question about the Stk library. >> Say I use one of the generator classes >> >> SineWave sine; >> sine.setFrequency(...) >> >> I don't see where is the SineWave instance err..instanced, like >> >> SineWave sine = new SineWave(); >> >> as those are not class methods but instance methods. Is the sine >> constructed >> just by declaring it? >> Am I lost somewhere? >> >> Thanks in advance... >> Josep M > > _______________________________________________ > Stk mailing list > Stk@ccrma.stanford.edu > http://ccrma-mail.stanford.edu/mailman/listinfo/stk > From josep.comajuncosas@wanadoo.es Sat Mar 24 18:20:37 2007 From: josep.comajuncosas@wanadoo.es (Josep M Comajuncosas) Date: Sat, 24 Mar 2007 18:20:37 +0100 Subject: [Stk] newbie question In-Reply-To: Message-ID: <200703241720.l2OHKkN08818@cm-mail.stanford.edu> Thanks all, I thought it had to be a java-style syntax. Everything is fine now. Many thanks to all to help me in such a trivial question, Josep M -----Missatge original----- De: stk-admin@ccrma.Stanford.EDU [mailto:stk-admin@ccrma.Stanford.EDU] En nom de Perry R Cook Enviat: sábado, 24 de marzo de 2007 17:45 Per a: Michael Chinen a/c: Josep M Comajuncosas; stk@ccrma.Stanford.EDU Tema: Re: [Stk] newbie question Josep, Michael is right on. You need to use the pointer form if you want to call a constructor that takes arguments. A class may have more than one constructor, a default without arguments, which is automagically called when you declare an instance of it, and others which might take arguments. PRC On Sun, 25 Mar 2007, Michael Chinen wrote: > Hi Josep, > > STK is written for C++, so objects will be allocated when their > variables are declared. > > SineWave sine; > > will allocate and call the SineWave() constructor for the sine > variable behind the scenes. > > You are of thinking of Java or C#, perhaps, where objects are all pointers. > If you want to do newing, you will need to explicitly declare the > variable a pointer, such as > > SineWave* sine = new SineWave(); > sine->setFrequency(..); > > HTH > > Michael > > > > On 3/24/07, Josep M Comajuncosas wrote: >> >> >> Hi, >> just an , I guess, idiomatic question about the Stk library. >> Say I use one of the generator classes >> >> SineWave sine; >> sine.setFrequency(...) >> >> I don't see where is the SineWave instance err..instanced, like >> >> SineWave sine = new SineWave(); >> >> as those are not class methods but instance methods. Is the sine >> constructed just by declaring it? >> Am I lost somewhere? >> >> Thanks in advance... >> Josep M > > _______________________________________________ > Stk mailing list > Stk@ccrma.stanford.edu > http://ccrma-mail.stanford.edu/mailman/listinfo/stk > _______________________________________________ Stk mailing list Stk@ccrma.stanford.edu http://ccrma-mail.stanford.edu/mailman/listinfo/stk