<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: scanf in C : Reading single line of text using &quot;scanf&quot; function</title>
	<atom:link href="http://codereflect.com/2006/10/25/scanf-in-c-reading-single-line-of-text-using-scanf-function/feed/" rel="self" type="application/rss+xml" />
	<link>http://codereflect.com/2006/10/25/scanf-in-c-reading-single-line-of-text-using-scanf-function/</link>
	<description>On Windows Programming, Technical Tips etc...</description>
	<lastBuildDate>Fri, 30 Jul 2010 00:48:11 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
	<item>
		<title>By: Paulo R Stradioti</title>
		<link>http://codereflect.com/2006/10/25/scanf-in-c-reading-single-line-of-text-using-scanf-function/comment-page-1/#comment-2515</link>
		<dc:creator>Paulo R Stradioti</dc:creator>
		<pubDate>Wed, 16 Jun 2010 21:28:06 +0000</pubDate>
		<guid isPermaLink="false">http://sarathc.wordpress.com/2006/10/25/scanf-in-c-reading-single-line-of-text-using-scanf-function/#comment-2515</guid>
		<description>Hello,&lt;br&gt;&lt;br&gt;Thanks for sharing such a smart and easy way to do a simple task!&lt;br&gt;&lt;br&gt;Paulo</description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>Thanks for sharing such a smart and easy way to do a simple task!</p>
<p>Paulo</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stepnowski</title>
		<link>http://codereflect.com/2006/10/25/scanf-in-c-reading-single-line-of-text-using-scanf-function/comment-page-1/#comment-1990</link>
		<dc:creator>Stepnowski</dc:creator>
		<pubDate>Sat, 29 Aug 2009 07:40:34 +0000</pubDate>
		<guid isPermaLink="false">http://sarathc.wordpress.com/2006/10/25/scanf-in-c-reading-single-line-of-text-using-scanf-function/#comment-1990</guid>
		<description>I would like to see more blog entries like this one</description>
		<content:encoded><![CDATA[<p>I would like to see more blog entries like this one</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bubba</title>
		<link>http://codereflect.com/2006/10/25/scanf-in-c-reading-single-line-of-text-using-scanf-function/comment-page-1/#comment-1987</link>
		<dc:creator>Bubba</dc:creator>
		<pubDate>Thu, 30 Jul 2009 15:06:23 +0000</pubDate>
		<guid isPermaLink="false">http://sarathc.wordpress.com/2006/10/25/scanf-in-c-reading-single-line-of-text-using-scanf-function/#comment-1987</guid>
		<description>Or, we can just use

#include
int main()
{
char name[99];
printf(&quot;What is your name? &quot;);
scanf(&quot;%s&quot;,&amp;name);
printf(&quot;Hello, %s. How are you?\n&quot;,name);
return(0);
}

Same result.</description>
		<content:encoded><![CDATA[<p>Or, we can just use</p>
<p>#include<br />
int main()<br />
{<br />
char name[99];<br />
printf(&#8220;What is your name? &#8220;);<br />
scanf(&#8220;%s&#8221;,&amp;name);<br />
printf(&#8220;Hello, %s. How are you?\n&#8221;,name);<br />
return(0);<br />
}</p>
<p>Same result.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bubba</title>
		<link>http://codereflect.com/2006/10/25/scanf-in-c-reading-single-line-of-text-using-scanf-function/comment-page-1/#comment-1986</link>
		<dc:creator>Bubba</dc:creator>
		<pubDate>Thu, 30 Jul 2009 07:23:49 +0000</pubDate>
		<guid isPermaLink="false">http://sarathc.wordpress.com/2006/10/25/scanf-in-c-reading-single-line-of-text-using-scanf-function/#comment-1986</guid>
		<description>Oddly,
The post deleted what was in the brackets after include (which was simply  &quot;stdio.h&quot;)</description>
		<content:encoded><![CDATA[<p>Oddly,<br />
The post deleted what was in the brackets after include (which was simply  &#8220;stdio.h&#8221;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bubba</title>
		<link>http://codereflect.com/2006/10/25/scanf-in-c-reading-single-line-of-text-using-scanf-function/comment-page-1/#comment-1985</link>
		<dc:creator>Bubba</dc:creator>
		<pubDate>Thu, 30 Jul 2009 07:21:30 +0000</pubDate>
		<guid isPermaLink="false">http://sarathc.wordpress.com/2006/10/25/scanf-in-c-reading-single-line-of-text-using-scanf-function/#comment-1985</guid>
		<description>(To Sub)Two questions back:

Here is a simple snippet to answer your question:

#include

int main(int argc, char *argv[])
{
   char first_name[100];

   printf(&quot;What is your name?  &quot;);
   gets(first_name);
   printf(&quot;\nNice to meet you %s!&quot;,first_name);
   return 0;
}


Try this, I hope it helps in some small way.....</description>
		<content:encoded><![CDATA[<p>(To Sub)Two questions back:</p>
<p>Here is a simple snippet to answer your question:</p>
<p>#include</p>
<p>int main(int argc, char *argv[])<br />
{<br />
   char first_name[100];</p>
<p>   printf(&#8220;What is your name?  &#8220;);<br />
   gets(first_name);<br />
   printf(&#8220;\nNice to meet you %s!&#8221;,first_name);<br />
   return 0;<br />
}</p>
<p>Try this, I hope it helps in some small way&#8230;..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: ullas</title>
		<link>http://codereflect.com/2006/10/25/scanf-in-c-reading-single-line-of-text-using-scanf-function/comment-page-1/#comment-1992</link>
		<dc:creator>ullas</dc:creator>
		<pubDate>Tue, 07 Jul 2009 04:00:15 +0000</pubDate>
		<guid isPermaLink="false">http://sarathc.wordpress.com/2006/10/25/scanf-in-c-reading-single-line-of-text-using-scanf-function/#comment-1992</guid>
		<description>Hey this is not working.....</description>
		<content:encoded><![CDATA[<p>Hey this is not working&#8230;..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: sub</title>
		<link>http://codereflect.com/2006/10/25/scanf-in-c-reading-single-line-of-text-using-scanf-function/comment-page-1/#comment-1991</link>
		<dc:creator>sub</dc:creator>
		<pubDate>Mon, 06 Jul 2009 11:02:12 +0000</pubDate>
		<guid isPermaLink="false">http://sarathc.wordpress.com/2006/10/25/scanf-in-c-reading-single-line-of-text-using-scanf-function/#comment-1991</guid>
		<description>i didn&#039;t get tis.... none of the codes worked for me,including the one containing regular expressions.
how do we read a line from the user in C.</description>
		<content:encoded><![CDATA[<p>i didn&#8217;t get tis&#8230;. none of the codes worked for me,including the one containing regular expressions.<br />
how do we read a line from the user in C.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: diapir</title>
		<link>http://codereflect.com/2006/10/25/scanf-in-c-reading-single-line-of-text-using-scanf-function/comment-page-1/#comment-1988</link>
		<dc:creator>diapir</dc:creator>
		<pubDate>Mon, 01 Jun 2009 07:59:53 +0000</pubDate>
		<guid isPermaLink="false">http://sarathc.wordpress.com/2006/10/25/scanf-in-c-reading-single-line-of-text-using-scanf-function/#comment-1988</guid>
		<description>Cool reminder. I used this thing to skip comments in a file :

// eat spaces
// match &#039;#&#039;
// capture and discard everything until end of line
fscanf(stream, &quot; #%*[^\n]&quot;);

Cheers</description>
		<content:encoded><![CDATA[<p>Cool reminder. I used this thing to skip comments in a file :</p>
<p>// eat spaces<br />
// match &#8216;#&#8217;<br />
// capture and discard everything until end of line<br />
fscanf(stream, &#8221; #%*[^\n]&#8220;);</p>
<p>Cheers</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://codereflect.com/2006/10/25/scanf-in-c-reading-single-line-of-text-using-scanf-function/comment-page-1/#comment-1993</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Sun, 17 May 2009 10:28:34 +0000</pubDate>
		<guid isPermaLink="false">http://sarathc.wordpress.com/2006/10/25/scanf-in-c-reading-single-line-of-text-using-scanf-function/#comment-1993</guid>
		<description>[...] Datei lesen und an bestimmer Stelle verändern     Am besten ist vielleicht, immer ein komplette Zeile einzulesen. Dann musst du immer prüfen, ob du nun an dem zu editierenden Block angekommen bist. Das kann man [...]</description>
		<content:encoded><![CDATA[<p>[...] Datei lesen und an bestimmer Stelle verändern     Am besten ist vielleicht, immer ein komplette Zeile einzulesen. Dann musst du immer prüfen, ob du nun an dem zu editierenden Block angekommen bist. Das kann man [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Will</title>
		<link>http://codereflect.com/2006/10/25/scanf-in-c-reading-single-line-of-text-using-scanf-function/comment-page-1/#comment-1989</link>
		<dc:creator>Will</dc:creator>
		<pubDate>Tue, 07 Apr 2009 13:56:41 +0000</pubDate>
		<guid isPermaLink="false">http://sarathc.wordpress.com/2006/10/25/scanf-in-c-reading-single-line-of-text-using-scanf-function/#comment-1989</guid>
		<description>Use fgets instead...

The version that is not vulnerable to buffer overflows is:

char name[100];

printf(”Enter the name:”);
fgets(name,100,stdin);

Hope that helps...</description>
		<content:encoded><![CDATA[<p>Use fgets instead&#8230;</p>
<p>The version that is not vulnerable to buffer overflows is:</p>
<p>char name[100];</p>
<p>printf(”Enter the name:”);<br />
fgets(name,100,stdin);</p>
<p>Hope that helps&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
