<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7723383997131918699</id><updated>2012-02-16T04:06:04.569-08:00</updated><category term='Trying to compile in Borland&apos;s platform.'/><category term='Repeat Repeat Repeat'/><category term='OOP344'/><title type='text'>ScsC's Blog</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://s2000c.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7723383997131918699/posts/default/-/OOP344'/><link rel='alternate' type='text/html' href='http://s2000c.blogspot.com/search/label/OOP344'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>ScsC</name><uri>http://www.blogger.com/profile/02992430785502413088</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>1</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7723383997131918699.post-5951697324358101132</id><published>2010-03-02T21:34:00.000-08:00</published><updated>2010-03-03T20:38:24.193-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='OOP344'/><title type='text'>A closer look at #define</title><content type='html'>Today as I was starting on assignment#2, I've found out that in a #define statement one can just call it's index like in an array.&lt;br /&gt;e.g. #define whatever "abcde"&lt;br /&gt;one can just code: whatever[1] and if called correctly it should output the letter b.&lt;br /&gt;&lt;br /&gt;Besides what I've just mentioned,&amp;nbsp;however, we also needed to use this character: \ or&amp;nbsp;the&amp;nbsp;backslash in the define statement.&lt;br /&gt;And what I've found out is that anytime one see the first \ it probably acts like Pearl's escapes,&amp;nbsp;escaping the next character, but I think it's using printf's forward declaration or some sort&amp;nbsp;to see&amp;nbsp;what's the next character and&amp;nbsp;if it is: either an n, t, b, etc. the backslash will escape&amp;nbsp;those key letters representing newline, tab, beep respectively&amp;nbsp;including itself all together; else it will&amp;nbsp;probably just escape itself.&amp;nbsp; In this case the missing \ in index [0, 2, 4, 7, 9, 11, 13, 18] shows the escaping itself effect and the \n escaping both the backslash and the n, all together, because of the key-letter n.&amp;nbsp;&amp;nbsp; Hoping I've concluded this correctly...&lt;br /&gt;Try this code: &lt;style type="text/css"&gt;.code0 { font-size: small; font-family: Consolas, "Courier New", Courier, Monospace; color: #000000; background-color: #ffffff; } .code1 { margin: 0em; } .code2 { margin: 0em; width: 100%; background-color: #f0f0f0; } .code3 { color: #008000; } .code4 { color: #ff0000; } .code5 { color: #191970; font-weight: bold; } .code6 { color: #006400; } .code7 { color: #ff00ff; } .code8 { color: #000000; } .code9 { color: #00008b; } &lt;/style&gt;&lt;br /&gt;&lt;div class="code0"&gt;&lt;span style="color: blue; font-size: x-small;"&gt;#define&lt;span style="font-size: x-small;"&gt; WHATEVER &lt;/span&gt;&lt;span style="color: #a31515; font-size: x-small;"&gt;"abcde"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue; font-size: x-small;"&gt;#define&lt;/span&gt;&lt;span style="font-size: x-small;"&gt; INDEX_CHARS &lt;/span&gt;&lt;span style="color: #a31515; font-size: x-small;"&gt;"\\\!\/-\\\\\\\\|/-\\|"&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue; font-size: x-small;"&gt;#include&lt;/span&gt;&lt;span style="font-size: x-small;"&gt; &lt;/span&gt;&lt;span style="color: #a31515; font-size: x-small;"&gt;&amp;lt;stdio.h&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="color: blue; font-size: x-small;"&gt;void&lt;span style="font-size: x-small;"&gt; main(&lt;/span&gt;&lt;span style="color: blue; font-size: x-small;"&gt;void&lt;/span&gt;&lt;span style="font-size: x-small;"&gt;){&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;printf(&lt;span style="color: #a31515; font-size: x-small;"&gt;"%c\n"&lt;/span&gt;&lt;span style="font-size: x-small;"&gt;, WHATEVER[1]);&lt;/span&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;printf(&lt;span style="color: #a31515; font-size: x-small;"&gt;"\\\!\/-\\\\\\\\|/-\\| \n"&lt;/span&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;printf(&lt;span style="font-size: x-small;"&gt;&lt;/span&gt;&lt;span style="color: #a31515; font-size: x-small;"&gt;"%s\n"&lt;/span&gt;&lt;span style="font-size: x-small;"&gt;, INDEX_CHARS);&lt;/span&gt;&lt;br /&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;And the outcome is: &lt;br /&gt;&lt;div class="separator" style="border-bottom: medium none; border-left: medium none; border-right: medium none; border-top: medium none; clear: both; text-align: center;"&gt;&lt;a href="http://2.bp.blogspot.com/_IthYkIUNgGw/S48tu081KyI/AAAAAAAAAAw/xang32j3kSM/s1600-h/practice_ex.jpg" imageanchor="1" style="clear: left; cssfloat: left; float: left; margin-bottom: 1em; margin-right: 1em;"&gt;&lt;img border="0" kt="true" src="http://2.bp.blogspot.com/_IthYkIUNgGw/S48tu081KyI/AAAAAAAAAAw/xang32j3kSM/s320/practice_ex.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7723383997131918699-5951697324358101132?l=s2000c.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://s2000c.blogspot.com/feeds/5951697324358101132/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://s2000c.blogspot.com/2010/03/closer-look-at-define.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7723383997131918699/posts/default/5951697324358101132'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7723383997131918699/posts/default/5951697324358101132'/><link rel='alternate' type='text/html' href='http://s2000c.blogspot.com/2010/03/closer-look-at-define.html' title='A closer look at #define'/><author><name>ScsC</name><uri>http://www.blogger.com/profile/02992430785502413088</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_IthYkIUNgGw/S48tu081KyI/AAAAAAAAAAw/xang32j3kSM/s72-c/practice_ex.jpg' height='72' width='72'/><thr:total>0</thr:total></entry></feed>
