<?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>TechPitcher &#187; C++</title>
	<atom:link href="http://www.techpitcher.com/category/c/feed" rel="self" type="application/rss+xml" />
	<link>http://www.techpitcher.com</link>
	<description></description>
	<lastBuildDate>Mon, 20 Dec 2010 10:28:24 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Implement strtok() function. (It tokenizes the string )</title>
		<link>http://www.techpitcher.com/implement-strtok-function-it-tokenizes-the-string.html</link>
		<comments>http://www.techpitcher.com/implement-strtok-function-it-tokenizes-the-string.html#comments</comments>
		<pubDate>Sun, 04 May 2008 18:28:35 +0000</pubDate>
		<dc:creator>Abhishek</dc:creator>
				<category><![CDATA[C++]]></category>

		<guid isPermaLink="false">http://techpitcher.com/?p=23</guid>
		<description><![CDATA[Implementation of strtok
char* strtok(char *s, const char *delim) {
static char *old = NULL;
char *token;
if(! s) {
s = old;
if(! s) {
return NULL;
}
}
if(s) {
s += strspn(s, delim);
if(*s == 0) {
old = NULL;
return NULL;
}
}
token = s;
s = strpbrk(s, delim);
if(s == NULL) {
old = NULL;
} else {
*s = 0;
old = s + 1;
}
return token;
}
]]></description>
			<content:encoded><![CDATA[<p>Implementation of strtok</p>
<p>char* strtok(char *s, const char *delim) {<br />
static char *old = NULL;<br />
char *token;<br />
if(! s) {<br />
s = old;<br />
if(! s) {<br />
return NULL;<br />
}<br />
}<br />
if(s) {<br />
s += strspn(s, delim);<br />
if(*s == 0) {<br />
old = NULL;<br />
return NULL;<br />
}<br />
}</p>
<p>token = s;<br />
s = strpbrk(s, delim);<br />
if(s == NULL) {<br />
old = NULL;<br />
} else {<br />
*s = 0;<br />
old = s + 1;<br />
}<br />
return token;<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>http://www.techpitcher.com/implement-strtok-function-it-tokenizes-the-string.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Write implementation of memcpy and memmove functions? What is the difference between the two?</title>
		<link>http://www.techpitcher.com/write-implementation-of-memcpy-and-memmove-functions-what-is-the-difference-between-the-two.html</link>
		<comments>http://www.techpitcher.com/write-implementation-of-memcpy-and-memmove-functions-what-is-the-difference-between-the-two.html#comments</comments>
		<pubDate>Fri, 04 Apr 2008 18:23:47 +0000</pubDate>
		<dc:creator>Abhishek</dc:creator>
				<category><![CDATA[C++]]></category>

		<guid isPermaLink="false">http://techpitcher.com/?p=22</guid>
		<description><![CDATA[Implementation of memcpy
void memcpy(void* dest, void* src, int n_size)  {
char* d = (char*) dest;
char* s = (char*) src;
while(n_size&#8211; > 0) {
*d++ = *s++;
}
}
Implementation of memmove
void memmove(void* dest, void* src, int n_size) {
char* d = (char*) dest;
char* s = (char*) src;
if(d > s) {
while(n_size&#8211; > 0) {
*d&#8211; = *s&#8211;;
}
} else {
while(n_size&#8211; > 0) {
*d++ = [...]]]></description>
			<content:encoded><![CDATA[<p>Implementation of memcpy</p>
<p>void memcpy(void* dest, void* src, int n_size)  {<br />
char* d = (char*) dest;<br />
char* s = (char*) src;<br />
while(n_size&#8211; > 0) {<br />
*d++ = *s++;<br />
}<br />
}</p>
<p>Implementation of memmove</p>
<p>void memmove(void* dest, void* src, int n_size) {<br />
char* d = (char*) dest;<br />
char* s = (char*) src;<br />
if(d > s) {<br />
while(n_size&#8211; > 0) {<br />
*d&#8211; = *s&#8211;;<br />
}<br />
} else {<br />
while(n_size&#8211; > 0) {<br />
*d++ = *s++;<br />
}<br />
}<br />
}</p>
<p>memmove ensure correct copying when the two buffers overlap.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.techpitcher.com/write-implementation-of-memcpy-and-memmove-functions-what-is-the-difference-between-the-two.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What is a dangling pointer?</title>
		<link>http://www.techpitcher.com/what-is-a-dangling-pointer.html</link>
		<comments>http://www.techpitcher.com/what-is-a-dangling-pointer.html#comments</comments>
		<pubDate>Tue, 04 Mar 2008 18:21:56 +0000</pubDate>
		<dc:creator>Amit</dc:creator>
				<category><![CDATA[C++]]></category>

		<guid isPermaLink="false">http://techpitcher.com/?p=21</guid>
		<description><![CDATA[A dangling pointer is a pointer to memory that is no longer allocated. The pointer still points to the memory which earlier was allocated for the data. The data is deleted and the memory may now be used with some other purpose.
{
char *danglingPointer = NULL;
/* &#8230; */
{
char localChar;
danglingPointer = &localChar;
}
/* Memory was allocated to danglingPointer [...]]]></description>
			<content:encoded><![CDATA[<p>A dangling pointer is a pointer to memory that is no longer allocated. The pointer still points to the memory which earlier was allocated for the data. The data is deleted and the memory may now be used with some other purpose.</p>
<p>{<br />
char *danglingPointer = NULL;<br />
/* &#8230; */<br />
{<br />
char localChar;<br />
danglingPointer = &localChar;<br />
}<br />
/* Memory was allocated to danglingPointer in the block. */<br />
/* As soon as program is out of block dandlingPointer points to Memory, */<br />
/* which is free for other use.*/<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>http://www.techpitcher.com/what-is-a-dangling-pointer.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What is a double pointer? Why is it required? Is it necessary in C++?</title>
		<link>http://www.techpitcher.com/what-is-a-double-pointer-why-is-it-required-is-it-necessary-in-c.html</link>
		<comments>http://www.techpitcher.com/what-is-a-double-pointer-why-is-it-required-is-it-necessary-in-c.html#comments</comments>
		<pubDate>Mon, 04 Feb 2008 18:20:40 +0000</pubDate>
		<dc:creator>Abhishek</dc:creator>
				<category><![CDATA[C++]]></category>

		<guid isPermaLink="false">http://techpitcher.com/?p=20</guid>
		<description><![CDATA[Pointer to a pointer is called double pointer. It is needed when one wants to manipulate the pointer itself like in linked list manipulation etc. In C++ same thing can be accomplished using reference which also avoids the overhead of copying.
]]></description>
			<content:encoded><![CDATA[<p>Pointer to a pointer is called double pointer. It is needed when one wants to manipulate the pointer itself like in linked list manipulation etc. In C++ same thing can be accomplished using reference which also avoids the overhead of copying.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.techpitcher.com/what-is-a-double-pointer-why-is-it-required-is-it-necessary-in-c.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

