<?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>GeeksforGeeks</title>
	<atom:link href="http://geeksforgeeks.org/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://geeksforgeeks.org</link>
	<description>Add Interview/written questions to Interview Corner!!</description>
	<lastBuildDate>Wed, 08 Sep 2010 05:40:04 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>G-Fact 30</title>
		<link>http://geeksforgeeks.org/?p=8539</link>
		<comments>http://geeksforgeeks.org/?p=8539#comments</comments>
		<pubDate>Tue, 07 Sep 2010 09:05:20 +0000</pubDate>
		<dc:creator>GeeksforGeeks</dc:creator>
				<category><![CDATA[GFacts]]></category>

		<guid isPermaLink="false">http://geeksforgeeks.org/?p=8539</guid>
		<description><![CDATA[In C++, delete operator should only be used either for the pointers pointing to the memory allocated using new operator or for a NULL pointer, and free() should only be used either for the pointers pointing to the memory allocated using malloc() or for a NULL pointer. 

#include&#60;stdio.h&#62;
#include&#60;stdlib.h&#62;
int main()
{
    int x;
  [...]]]></description>
		<wfw:commentRss>http://geeksforgeeks.org/?feed=rss2&amp;p=8539</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Comma in C and C++</title>
		<link>http://geeksforgeeks.org/?p=8482</link>
		<comments>http://geeksforgeeks.org/?p=8482#comments</comments>
		<pubDate>Sun, 29 Aug 2010 13:29:55 +0000</pubDate>
		<dc:creator>GeeksforGeeks</dc:creator>
				<category><![CDATA[C/C++ Puzzles]]></category>

		<guid isPermaLink="false">http://geeksforgeeks.org/?p=8482</guid>
		<description><![CDATA[In C and C++, comma (,) can be used in two contexts: 
1) Comma as an operator:
The comma operator (represented by the token ,) is a binary operator that evaluates its first operand and discards the result, it then evaluates the second operand and returns this value (and type). The comma operator has the lowest [...]]]></description>
		<wfw:commentRss>http://geeksforgeeks.org/?feed=rss2&amp;p=8482</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Output of C Program &#124; Set 17</title>
		<link>http://geeksforgeeks.org/?p=8453</link>
		<comments>http://geeksforgeeks.org/?p=8453#comments</comments>
		<pubDate>Fri, 27 Aug 2010 07:21:42 +0000</pubDate>
		<dc:creator>GeeksforGeeks</dc:creator>
				<category><![CDATA[Output]]></category>

		<guid isPermaLink="false">http://geeksforgeeks.org/?p=8453</guid>
		<description><![CDATA[Predict the output of following C programs.
Question 1

#include&#60;stdio.h&#62;

#define R 10
#define C 20

int main()
{
   int (*p)[R][C];
   printf(&#34;%d&#34;,  sizeof(*p));
   getchar();
   return 0;
}

Output: 10*20*sizeof(int) which is &#8220;800&#8243; for compilers with integer size as 4 bytes.
The pointer p is de-referenced, hence it yields type of the object. In the present [...]]]></description>
		<wfw:commentRss>http://geeksforgeeks.org/?feed=rss2&amp;p=8453</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>malloc() vs new()</title>
		<link>http://geeksforgeeks.org/?p=8378</link>
		<comments>http://geeksforgeeks.org/?p=8378#comments</comments>
		<pubDate>Wed, 25 Aug 2010 15:50:02 +0000</pubDate>
		<dc:creator>GeeksforGeeks</dc:creator>
				<category><![CDATA[C/C++ Puzzles]]></category>

		<guid isPermaLink="false">http://geeksforgeeks.org/?p=8378</guid>
		<description><![CDATA[Following are the differences between malloc() and new(). 
1) new() calls constructors, while malloc() does not.  In fact primitive data types (char, int, float.. etc) can also be initialized with new().  For example, below program prints 10.

#include&#60;iostream&#62;

using namespace std;

int main()
{
   int *n = new int(10); // initialization with new()
   [...]]]></description>
		<wfw:commentRss>http://geeksforgeeks.org/?feed=rss2&amp;p=8378</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Output of C++ Program &#124; Set 1</title>
		<link>http://geeksforgeeks.org/?p=8418</link>
		<comments>http://geeksforgeeks.org/?p=8418#comments</comments>
		<pubDate>Fri, 20 Aug 2010 19:53:14 +0000</pubDate>
		<dc:creator>GeeksforGeeks</dc:creator>
				<category><![CDATA[Output]]></category>

		<guid isPermaLink="false">http://geeksforgeeks.org/?p=8418</guid>
		<description><![CDATA[Predict the output of below C++ programs. 
Question 1

// Assume that integers take 4 bytes.
#include&#60;iostream&#62;

using namespace std;   

class Test
{
  static int i;
  int j;
};

int Test::i;

int main()
{
    cout &#60;&#60; sizeof(Test);
    getchar();
    return 0;
}

Output: 4 (size of integer)
static data members do not contribute in [...]]]></description>
		<wfw:commentRss>http://geeksforgeeks.org/?feed=rss2&amp;p=8418</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>G-Fact 29</title>
		<link>http://geeksforgeeks.org/?p=8413</link>
		<comments>http://geeksforgeeks.org/?p=8413#comments</comments>
		<pubDate>Tue, 17 Aug 2010 18:33:27 +0000</pubDate>
		<dc:creator>GeeksforGeeks</dc:creator>
				<category><![CDATA[GFacts]]></category>

		<guid isPermaLink="false">http://geeksforgeeks.org/?p=8413</guid>
		<description><![CDATA[In C++, a static member function of a class cannot be virtual.  For example, below program gives compilation error.

#include&#60;iostream&#62;

using namespace std;    

class Test
{
   public:
      // Error: Virtual member functions cannot be static
      virtual static void fun()  { }
};

Also, [...]]]></description>
		<wfw:commentRss>http://geeksforgeeks.org/?feed=rss2&amp;p=8413</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Evaluation order of operands</title>
		<link>http://geeksforgeeks.org/?p=8389</link>
		<comments>http://geeksforgeeks.org/?p=8389#comments</comments>
		<pubDate>Sat, 14 Aug 2010 05:05:50 +0000</pubDate>
		<dc:creator>GeeksforGeeks</dc:creator>
				<category><![CDATA[C/C++ Puzzles]]></category>

		<guid isPermaLink="false">http://geeksforgeeks.org/?p=8389</guid>
		<description><![CDATA[Consider the below C/C++ program. 

#include&#60;stdio.h&#62;
int x = 0;

int f1()
{
  x = 5;
  return x;
}

int f2()
{
  x = 10;
  return x;
}

int main()
{
  int p = f1() + f2();
  printf(&#34;%d &#34;, x);
  getchar();
  return 0;
}

What would the output of the above program &#8211; &#8216;5&#8242; or &#8216;10&#8242;?
The output is [...]]]></description>
		<wfw:commentRss>http://geeksforgeeks.org/?feed=rss2&amp;p=8389</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>G-Fact 28</title>
		<link>http://geeksforgeeks.org/?p=8383</link>
		<comments>http://geeksforgeeks.org/?p=8383#comments</comments>
		<pubDate>Thu, 12 Aug 2010 15:38:33 +0000</pubDate>
		<dc:creator>GeeksforGeeks</dc:creator>
				<category><![CDATA[GFacts]]></category>

		<guid isPermaLink="false">http://geeksforgeeks.org/?p=8383</guid>
		<description><![CDATA[Enumeration constants (enum values) are always of type int in C, whereas they are distinct types in C++ and may have size different from that of int.
Source:
http://en.wikipedia.org/wiki/Compatibility_of_C_and_C%2B%2B
]]></description>
		<wfw:commentRss>http://geeksforgeeks.org/?feed=rss2&amp;p=8383</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Output of C Programs &#124; Set 16</title>
		<link>http://geeksforgeeks.org/?p=8355</link>
		<comments>http://geeksforgeeks.org/?p=8355#comments</comments>
		<pubDate>Mon, 09 Aug 2010 18:58:19 +0000</pubDate>
		<dc:creator>GeeksforGeeks</dc:creator>
				<category><![CDATA[Output]]></category>

		<guid isPermaLink="false">http://geeksforgeeks.org/?p=8355</guid>
		<description><![CDATA[Predict the output of below C programs.
Question 1

#include &#60;stdio.h&#62;

char* fun()
{
  return &#34;awake&#34;;
}
int main()
{
  printf(&#34;%s&#34;,fun()+ printf(&#34;I see you&#34;));
  getchar();
  return 0;
}

Output: Some string starting with &#8220;I see you&#8221;
Explanation: (Thanks to Venki for suggesting this solution)
The function fun() returns pointer to char. Apart from printing string &#8220;I see you&#8221;, printf() function returns number [...]]]></description>
		<wfw:commentRss>http://geeksforgeeks.org/?feed=rss2&amp;p=8355</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>G-Fact 27</title>
		<link>http://geeksforgeeks.org/?p=7917</link>
		<comments>http://geeksforgeeks.org/?p=7917#comments</comments>
		<pubDate>Thu, 05 Aug 2010 10:58:44 +0000</pubDate>
		<dc:creator>GeeksforGeeks</dc:creator>
				<category><![CDATA[GFacts]]></category>

		<guid isPermaLink="false">http://geeksforgeeks.org/?p=7917</guid>
		<description><![CDATA[Calling an undeclared function is poor style in C and illegal in C++. So is passing arguments to a function using a declaration that doesn&#8217;t list argument types: 
If we save the below program in a .c file and compile it, it works without any error. But, if we save the same in a .cpp [...]]]></description>
		<wfw:commentRss>http://geeksforgeeks.org/?feed=rss2&amp;p=7917</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Print &#8220;Even&#8221; or &#8220;Odd&#8221; without using Condtional statement</title>
		<link>http://geeksforgeeks.org/?p=8337</link>
		<comments>http://geeksforgeeks.org/?p=8337#comments</comments>
		<pubDate>Thu, 29 Jul 2010 15:12:58 +0000</pubDate>
		<dc:creator>GeeksforGeeks</dc:creator>
				<category><![CDATA[C/C++ Puzzles]]></category>

		<guid isPermaLink="false">http://geeksforgeeks.org/?p=8337</guid>
		<description><![CDATA[Write a C/C++ program that accepts a number from the user and prints &#8220;Even&#8221; if the entered number is even and prints &#8220;Odd&#8221; if the number is odd.  Your are not allowed to use any comparison (==, ..etc) or conditional (if, else, switch, ternary operator,..etc) statement.
Solution:
Below tricky code can be used to print &#8220;Even&#8221; [...]]]></description>
		<wfw:commentRss>http://geeksforgeeks.org/?feed=rss2&amp;p=8337</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>G-Fact 26</title>
		<link>http://geeksforgeeks.org/?p=8316</link>
		<comments>http://geeksforgeeks.org/?p=8316#comments</comments>
		<pubDate>Wed, 28 Jul 2010 15:50:23 +0000</pubDate>
		<dc:creator>GeeksforGeeks</dc:creator>
				<category><![CDATA[GFacts]]></category>

		<guid isPermaLink="false">http://geeksforgeeks.org/?p=8316</guid>
		<description><![CDATA[In C++, compiler by default creates default constructor for every class.  But, if we define our own parametrized constructor, then compiler doesn&#8217;t create the default constructor and default constructor may not exist in the class.
For example, program 1 compiles without any error, but compilation of program 2 fails with error &#8220;no matching function for [...]]]></description>
		<wfw:commentRss>http://geeksforgeeks.org/?feed=rss2&amp;p=8316</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Output of C Programs &#124; Set 15</title>
		<link>http://geeksforgeeks.org/?p=8113</link>
		<comments>http://geeksforgeeks.org/?p=8113#comments</comments>
		<pubDate>Sat, 24 Jul 2010 20:04:13 +0000</pubDate>
		<dc:creator>GeeksforGeeks</dc:creator>
				<category><![CDATA[Output]]></category>

		<guid isPermaLink="false">http://geeksforgeeks.org/?p=8113</guid>
		<description><![CDATA[Predict the output of below C programs. 
Question 1

#include&#60;stdio.h&#62;
int main(void)
{
  int a = 1;
  int b = 0;
  b = ++a + ++a;
  printf(&#34;%d %d&#34;,a,b);
  getchar();
  return 0;
}

Output: Undefined Behavior
See http://en.wikipedia.org/wiki/C_syntax#Undefined_behavior )

Question 2

#include&#60;stdio.h&#62;

int main()
{
  int a[] = {1, 2, 3, 4, 5, 6};
  int *ptr = (int*)(&#38;a+1);
 [...]]]></description>
		<wfw:commentRss>http://geeksforgeeks.org/?feed=rss2&amp;p=8113</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
