<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xml:base="http://www.newlc.com" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
 <title>NewLC - TPtrC vs TText - Comments</title>
 <link>http://www.newlc.com/forum/tptrc-vs-ttext</link>
 <description>Comments for &quot;TPtrC vs TText&quot;</description>
 <language>en</language>
<item>
 <title>Re: TPtrC vs TText</title>
 <link>http://www.newlc.com/forum/tptrc-vs-ttext#comment-45121</link>
 <description>&lt;p&gt;I think you should ask yourself why you tried to cast it to a TText*?&lt;/p&gt;

&lt;p&gt;If you see a function called Printf(TSausages&amp; aSausages);&lt;/p&gt;

&lt;p&gt;and instead of passing it a TSausages object you tried to pass it a pointer to a TElephant object would you expect it to compile? If not, then why did you attempt a similar thing with TDesC&amp; and TText*?&lt;/p&gt;</description>
 <pubDate>Fri, 14 Mar 2008 16:51:27 +0100</pubDate>
 <dc:creator>Numpty Alert</dc:creator>
 <guid isPermaLink="false">comment 45121 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: TPtrC vs TText</title>
 <link>http://www.newlc.com/forum/tptrc-vs-ttext#comment-45112</link>
 <description>&lt;p&gt;Hi alh,&lt;/p&gt;

&lt;p&gt;Thanks for Helping &lt;/p&gt;</description>
 <pubDate>Fri, 14 Mar 2008 11:50:36 +0100</pubDate>
 <dc:creator>satishkhatri</dc:creator>
 <guid isPermaLink="false">comment 45112 at http://www.newlc.com</guid>
</item>
<item>
 <title>Re: TPtrC vs TText</title>
 <link>http://www.newlc.com/forum/tptrc-vs-ttext#comment-45109</link>
 <description>&lt;p&gt;Thats some crazy code you have there.&lt;/p&gt;

&lt;p&gt;your problem is that Printf on the console does not take a TText* pointer, but a reference to a TDesC.&lt;/p&gt;

&lt;p&gt;You can excange your crazy code blob with this:&lt;/p&gt;

&lt;p&gt;&lt;pre class=&quot;bb-code-block&quot;&gt;
_LIT(KT,&quot;Good boy&quot;);
console-&amp;gt;Printf(KT);
&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt;All the lines in there between, is totally unnecessary and just waste memory and CPU cycles.&lt;/p&gt;</description>
 <pubDate>Fri, 14 Mar 2008 09:53:37 +0100</pubDate>
 <dc:creator>alh</dc:creator>
 <guid isPermaLink="false">comment 45109 at http://www.newlc.com</guid>
</item>
<item>
 <title>TPtrC vs TText</title>
 <link>http://www.newlc.com/forum/tptrc-vs-ttext</link>
 <description>&lt;p&gt;Hi All,&lt;br /&gt;
           I am beginner in symbian C++ . I have the following code :&lt;/p&gt;

&lt;p&gt;               _LIT(KT,&quot;Good boy&quot;);&lt;br /&gt;
		TBufC&lt;12&gt;buf(KT);&lt;br /&gt;
		TPtrC ptr(buf);&lt;br /&gt;
		TText *text= (TText*)ptr.Ptr();&lt;br /&gt;
		console-&gt;Printf((TText*)text);&lt;br /&gt;
    &lt;br /&gt;
It gives the following error.&lt;br /&gt;
error C2664: &#039;Printf&#039; : cannot convert parameter 1 from &#039;unsigned short *&#039; to &#039;class TRefByValue&lt;class TDesC16 const &gt;&#039;&lt;br /&gt;
&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;http://www.newlc.com/forum/tptrc-vs-ttext&quot;&gt;read more&lt;/a&gt;&lt;/p&gt;</description>
 <comments>http://www.newlc.com/forum/tptrc-vs-ttext#comments</comments>
 <category domain="http://www.newlc.com/forums/symbian-c">Symbian C++</category>
 <pubDate>Fri, 14 Mar 2008 05:23:03 +0100</pubDate>
 <dc:creator>satishkhatri</dc:creator>
 <guid isPermaLink="false">20494 at http://www.newlc.com</guid>
</item>
</channel>
</rss>
