<?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: Negative characters in c</title>
	<atom:link href="https://www.emblogic.com/blog/06/negative-characters-in-c/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.emblogic.com/blog/06/negative-characters-in-c/</link>
	<description>Embedded System and ARM Training</description>
	<lastBuildDate>Mon, 07 Oct 2013 04:00:03 +0000</lastBuildDate>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.9.1</generator>
	<item>
		<title>By: kamran ali</title>
		<link>https://www.emblogic.com/blog/06/negative-characters-in-c/#comment-185</link>
		<dc:creator><![CDATA[kamran ali]]></dc:creator>
		<pubDate>Thu, 21 Jul 2011 18:46:10 +0000</pubDate>
		<guid isPermaLink="false">http://emblogic.org/blog/?p=746#comment-185</guid>
		<description><![CDATA[just to add in the above answer:the char holds 8bit in the memory.out of which the MSD is used as a flag.hence the break up of 8 bit is: 1 bit for signed and 7 bit for data bit.

example: char a=7;
7(dec)=111(binary)
so the 7 data bit are saved as: 0000111
and the 8 bit is 0 ( since it is signed).

Now for the next example:
char a=-7;
7(dec)=111(binary)
so the  bits are 00000111.But here is the catch, since the number is negative the complier save it as 2&#039;s compliment.

therefore,
1&#039;s compliment: 11111000 
adding 1 to it will give the 2&#039;s compliment
2&#039;s compliment : 11111001

the MSD give info to the complier that the input is a negative number: 

hope it will help.

As far as the need of negative char,
it depends on the programmer, but sometimes it is needed or in other words you are compelled to use it.]]></description>
		<content:encoded><![CDATA[<p>just to add in the above answer:the char holds 8bit in the memory.out of which the MSD is used as a flag.hence the break up of 8 bit is: 1 bit for signed and 7 bit for data bit.</p>
<p>example: char a=7;<br />
7(dec)=111(binary)<br />
so the 7 data bit are saved as: 0000111<br />
and the 8 bit is 0 ( since it is signed).</p>
<p>Now for the next example:<br />
char a=-7;<br />
7(dec)=111(binary)<br />
so the  bits are 00000111.But here is the catch, since the number is negative the complier save it as 2&#8242;s compliment.</p>
<p>therefore,<br />
1&#8242;s compliment: 11111000<br />
adding 1 to it will give the 2&#8242;s compliment<br />
2&#8242;s compliment : 11111001</p>
<p>the MSD give info to the complier that the input is a negative number: </p>
<p>hope it will help.</p>
<p>As far as the need of negative char,<br />
it depends on the programmer, but sometimes it is needed or in other words you are compelled to use it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: msiddarth</title>
		<link>https://www.emblogic.com/blog/06/negative-characters-in-c/#comment-174</link>
		<dc:creator><![CDATA[msiddarth]]></dc:creator>
		<pubDate>Sat, 25 Jun 2011 08:13:13 +0000</pubDate>
		<guid isPermaLink="false">http://emblogic.org/blog/?p=746#comment-174</guid>
		<description><![CDATA[The three types char, signed char, and unsigned char are collectively called the character types. 
Compilers have the latitude to define char to have the same range, representation, and behavior as either signed char or unsigned char. 
Irrespective of the choice made, char is a separate type from the other two and is not compatible with either.

Use only signed char and unsigned char types for the storage and use of numeric values, as this will take only one byte as comparison to integer which takes 4 bytes to store a numeric value. However, the restriction with respect to char data types is that it can take only upto 255 values only.]]></description>
		<content:encoded><![CDATA[<p>The three types char, signed char, and unsigned char are collectively called the character types.<br />
Compilers have the latitude to define char to have the same range, representation, and behavior as either signed char or unsigned char.<br />
Irrespective of the choice made, char is a separate type from the other two and is not compatible with either.</p>
<p>Use only signed char and unsigned char types for the storage and use of numeric values, as this will take only one byte as comparison to integer which takes 4 bytes to store a numeric value. However, the restriction with respect to char data types is that it can take only upto 255 values only.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
