<div>Ctrl-C (An interrupt) will kill the process currently running. So there&#39;s no way for you to say, &quot;If user kills my program, do this.&quot;</div>
<div>&nbsp;</div>
<div>Ctrl-D (EOF) However is a user-inputted key, and can be interpereted as the macro &lt;EOF&gt;. Thus, if encountered your program will still be running after it sees it, so it would be logical to close sockets and free up all your malloc&#39;d space before closing the process.
</div>
<div>&nbsp;</div>
<div>Then give a return value to your main function (mine is of type int so I return 0 for success).</div>
<div>Rick<br><br>&nbsp;</div>
<div><span class="gmail_quote">On 9/22/07, <b class="gmail_sendername">Linda Sha</b> &lt;<a href="mailto:lindablus@berkeley.edu">lindablus@berkeley.edu</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">I have trouble using cin to capture the &quot;EOT&quot;/Ctrl_D character. My program client program stopped running after I input Ctl-D + ENTER, but it won&#39;t get back to the command line either (unless I press ctrl_c). How should we deal with this character? 
<br><br>For Ctrl_C, is it ok to let the program terminate without closing the socket etc?<br><br>Thanks a lot!<br clear="all"><span class="sg"><br>Linda<br></span><br>_______________________________________________<br>ee122 mailing list
<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:ee122@mailman.ICSI.Berkeley.EDU">ee122@mailman.ICSI.Berkeley.EDU</a><br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://mailman.icsi.berkeley.edu/mailman/listinfo/ee122" target="_blank">
http://mailman.ICSI.Berkeley.EDU/mailman/listinfo/ee122</a><br><br></blockquote></div><br>