<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">


<META content="MSHTML 5.00.3315.2870" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><SPAN class=551375520-08072002>h<SPAN class=551375520-08072002>i 
all,</SPAN></SPAN></DIV>
<DIV><SPAN class=551375520-08072002><SPAN class=551375520-08072002>this is a 
very small doubt in c.</SPAN></SPAN></DIV>
<DIV><SPAN class=551375520-08072002><SPAN class=551375520-08072002>On execution 
the following program throws segmentation fault error.</SPAN></SPAN></DIV>
<DIV><SPAN class=551375520-08072002><SPAN 
class=551375520-08072002></SPAN></SPAN><SPAN class=551375520-08072002><SPAN 
class=551375520-08072002><BR>#include &lt;stdio.h&gt;<BR>#include 
&lt;string.h&gt;</SPAN></SPAN></DIV>
<DIV>&nbsp;</DIV>
<DIV><SPAN class=551375520-08072002><SPAN 
class=551375520-08072002>main()<BR>{<BR>int n;<BR>char *str, 
*str1;<BR>scanf("%s", str);<BR>scanf("%s", 
str1);<BR>scanf("%d",&amp;n);<BR>printf("%d\n", bcmp(str, str1, 
n));<BR>}</SPAN></SPAN></DIV>
<DIV><SPAN class=551375520-08072002><SPAN 
class=551375520-08072002></SPAN></SPAN>&nbsp;</DIV>
<DIV><SPAN class=551375520-08072002><SPAN class=551375520-08072002>Instead when 
the order of variable declaration is changed, program worked 
fine.</SPAN></SPAN></DIV>
<DIV><SPAN class=551375520-08072002><SPAN 
class=551375520-08072002></SPAN></SPAN>&nbsp;</DIV>
<DIV><SPAN class=551375520-08072002><SPAN class=551375520-08072002>May i know 
what makes the diffenence in the order of variable 
declarations.</SPAN></SPAN></DIV>
<DIV><SPAN class=551375520-08072002><SPAN 
class=551375520-08072002></SPAN></SPAN>&nbsp;</DIV>
<DIV><SPAN class=551375520-08072002>Regards,</SPAN></DIV>
<DIV><SPAN class=551375520-08072002>Goverthan</SPAN></DIV></BODY></HTML>