<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Technical Difficulties &#187; c</title>
	<atom:link href="http://greensoftware.net/blog/category/c/feed/" rel="self" type="application/rss+xml" />
	<link>http://greensoftware.net/blog</link>
	<description>Solving my problems</description>
	<lastBuildDate>Thu, 01 Jul 2010 16:46:16 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>The iPhone OS 4.0 Agreement stink.</title>
		<link>http://greensoftware.net/blog/2010/04/10/the-iphone-os-4-0-agreement-stink/</link>
		<comments>http://greensoftware.net/blog/2010/04/10/the-iphone-os-4-0-agreement-stink/#comments</comments>
		<pubDate>Sat, 10 Apr 2010 10:13:26 +0000</pubDate>
		<dc:creator>digitalSurgeon</dc:creator>
				<category><![CDATA[annoyances]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[nokia]]></category>
		<category><![CDATA[objective c]]></category>
		<category><![CDATA[iphone]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[phonegap]]></category>
		<category><![CDATA[webapps]]></category>

		<guid isPermaLink="false">http://greensoftware.net/blog/?p=253</guid>
		<description><![CDATA[So the internets are abuzz with the news that the new iphone os 4.0 developer agreement prohibits using any non apple endorsed programming language, framework for iphone/ipad development. This is hardly any thing surprising, given the way apple has been acting ever since jobs came back in control. When they were irrelevant they didn&#8217;t have [...]]]></description>
			<content:encoded><![CDATA[<p>So the internets are abuzz with the news that the new iphone os 4.0 developer agreement prohibits using any non apple endorsed programming language, framework for iphone/ipad development. This is hardly any thing surprising, given the way apple has been acting ever since jobs came back in control. When they were irrelevant they didn&#8217;t have the power to make any rules, now that they have a good market share, they are showing it. It almost feels like a kid who lost a game in his teens taking revenge in his 50&#8242;s. </p>
<p>Some people are comparing this with the Window Phone 7 Series and how its limited to .NET and C#, well that&#8217;s not exactly the same thing, Windows Phone 7 has no market share as of now, it will be coming to market in the late 2010. Microsoft sets this standard before they have any kind of market share, and besides any language ( php, vb, python ) can be used to create CLR code and that can be used for making apps on wp7 ( yet ).</p>
<p>But I believe apple has every right to do what it is doing. It might be good for the company, but sad for most of the developers. I myself was looking at <a href="http://www.monotouch.net">monotouch</a> as a tool for doing apps for iphone, but I went with objective c instead, it was not that difficult to learn and I think if you are a good c++ programmer objective c would be a piece of cake to learn, in two or three days. Monothouch is also just too expensive in my opinion.</p>
<p>However, like google has said earlier and I believe it myself that webapps are the future way of doing apps. <a href="http://www.phonegap.com">Phonegap</a> for example is an awesome project and it has a lot of potential, what we need now is standardization of web apps / javascripts apis. W3C for example has now standardized the Geolocation api, I think we need similar standard apis for example to access the phone book, sensors etc &#8230;.</p>
]]></content:encoded>
			<wfw:commentRss>http://greensoftware.net/blog/2010/04/10/the-iphone-os-4-0-agreement-stink/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>One good thing in Objective-C</title>
		<link>http://greensoftware.net/blog/2010/02/21/one-good-thing-in-objective-c/</link>
		<comments>http://greensoftware.net/blog/2010/02/21/one-good-thing-in-objective-c/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 12:24:15 +0000</pubDate>
		<dc:creator>digitalSurgeon</dc:creator>
				<category><![CDATA[c]]></category>
		<category><![CDATA[objective c]]></category>
		<category><![CDATA[annoyance]]></category>
		<category><![CDATA[objective-c]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://greensoftware.net/blog/?p=248</guid>
		<description><![CDATA[While learning about objective-c. I came across a single feature of objective-c which I think if moved to c++ would make for a lot less coding. Consider this objective c code for a class declaration: // .h file: @interface classname { // instance variables } +(void)classMethod; @end // .m file: @implementation classname -privateFunction1{} -classMethod { [...]]]></description>
			<content:encoded><![CDATA[<p>While learning about objective-c. I came across a single feature of objective-c which I think if moved to c++ would make for a lot less coding.</p>
<p>Consider this objective c code for a class declaration:<br />
<code><br />
// .h file:<br />
@interface classname  {<br />
    // instance variables<br />
}<br />
+(void)classMethod;<br />
@end</p>
<p>// .m file:<br />
@implementation classname<br />
-privateFunction1{}<br />
-classMethod { [self privateFunction1]; }<br />
@end<br />
</code></p>
<p>While if you would have to do something similar in c++, this is how you would do it:</p>
<p><code><br />
// .h file:<br />
class classname<br />
{<br />
public:<br />
void classMethod();</p>
<p>private:<br />
void privateFunction();<br />
}</p>
<p>// .cpp file:</p>
<p>void classname::classMethod()  { privateFunction(); }<br />
void classname::privateFunction()  {}</p>
<p></code></p>
<p>Even if a function in a C++ class is private, you still have to declare it in the class declaration. why ?<br />
It would be so much better if all the private functions can just placed in the cpp file, and we dont have to put them in the class declaration.</p>
<p>Objective C has the benefit of using @implementation &#8230; @end to figure out such methods. But if in c++ if we just declare a function in the .cpp file and such function is not present in the class declaration, the compiler can know that its a private function. Like so:</p>
<p><code><br />
// .h file:</p>
<p>class sample<br />
{<br />
public:<br />
 void doSomething();</p>
<p>private:<br />
int x;<br />
};</p>
<p>// .cpp file:</p>
<p>void sample::doSomethingPrivately()<br />
{<br />
// has access to member data.<br />
x = 7;<br />
}</p>
<p>void sample::doSomething()<br />
{<br />
 /// ...<br />
doSomethingPrivately();<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>http://greensoftware.net/blog/2010/02/21/one-good-thing-in-objective-c/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>c++ std::string</title>
		<link>http://greensoftware.net/blog/2009/07/10/c-stdstring/</link>
		<comments>http://greensoftware.net/blog/2009/07/10/c-stdstring/#comments</comments>
		<pubDate>Fri, 10 Jul 2009 18:28:30 +0000</pubDate>
		<dc:creator>digitalSurgeon</dc:creator>
				<category><![CDATA[c]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[std::string]]></category>
		<category><![CDATA[string]]></category>

		<guid isPermaLink="false">http://greensoftware.net/blog/?p=192</guid>
		<description><![CDATA[the c++ string or more specifically std::string is a great improvement over the c-strings which are null terminated. c++ strings use a length fields to keep track of how long the string is as compared to c-string which use the NULL &#8216;\0&#8242; character to keep track of where the string ends. The c-strings have been [...]]]></description>
			<content:encoded><![CDATA[<p>the c++ string or more specifically std::string is a great improvement over the c-strings which are null terminated. c++ strings use a length fields to keep track of how long the string is as compared to c-string which use the NULL &#8216;\0&#8242; character to keep track of where the string ends.</p>
<p>The c-strings have been around for so long and are used in so many places that when people start to use the std::string they get confused. For example today i wanted to use std::string to hold binary data, i knew that this was possible but i couldn&#8217;t figure out how. Then <a href="http://stackoverflow.com/questions/164168/how-do-you-construct-a-stdstring-with-an-embedded-null">stack overflow came to the rescue</a>. This question is explained very well there.</p>
<p>Thanks Stack Overflow <img src='http://greensoftware.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://greensoftware.net/blog/2009/07/10/c-stdstring/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
