<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<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">
	<channel>
		<title>LeafLabs Garden &#187; Topic: Cannot print a negative char</title>
		<link>http://forums.leaflabs.com/topic.php?id=662</link>
		<description>A place to share, learn, and grow...</description>
		<language>en-US</language>
		<pubDate>Fri, 22 Jan 2016 00:23:01 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://forums.leaflabs.com/search.php</link>
		</textInput>
		<atom:link href="http://forums.leaflabs.com/rss.php?topic=662" rel="self" type="application/rss+xml" />

		<item>
			<title>gbulmer on "Cannot print a negative char"</title>
			<link>http://forums.leaflabs.com/topic.php?id=662#post-3732</link>
			<pubDate>Thu, 24 Feb 2011 19:46:07 +0000</pubDate>
			<dc:creator>gbulmer</dc:creator>
			<guid isPermaLink="false">3732@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;A better solution is to explicitly declare the char as signed:&#60;br /&#62;
&#60;code&#62;signed char toto;&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;This has two benefits:&#60;br /&#62;
1. Everyone can understand the meaning of the type, and hence what should happen, by reading the program code that the compiler uses&#60;br /&#62;
2. it doesn't matter what the command line options to gcc are, so it should compile correctly in the Maple IDE, or the Arduino IDE, or any other C/C++ compiler
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Xavier on "Cannot print a negative char"</title>
			<link>http://forums.leaflabs.com/topic.php?id=662#post-3730</link>
			<pubDate>Thu, 24 Feb 2011 17:45:29 +0000</pubDate>
			<dc:creator>Xavier</dc:creator>
			<guid isPermaLink="false">3730@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Just got the solution after some research :&#60;br /&#62;
I added &#34;-fsigned-char&#34; in the list of arm-gcc params and everything work !&#60;/p&#62;
&#60;p&#62;:-)&#60;/p&#62;
&#60;p&#62;Xavier
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Xavier on "Cannot print a negative char"</title>
			<link>http://forums.leaflabs.com/topic.php?id=662#post-3729</link>
			<pubDate>Thu, 24 Feb 2011 17:26:48 +0000</pubDate>
			<dc:creator>Xavier</dc:creator>
			<guid isPermaLink="false">3729@http://forums.leaflabs.com/</guid>
			<description>&#60;p&#62;Hi, &#60;/p&#62;
&#60;p&#62;I have some negative numbered value contained in 'char' and i cannot get them displayed properly.&#60;/p&#62;
&#60;p&#62;&#60;code&#62;&#60;br /&#62;
int value;&#60;br /&#62;
char toto = -4;&#60;br /&#62;
value = value;&#60;br /&#62;
lcd-&#38;gt;print(value);&#60;br /&#62;
SerialUSB.println(value);&#60;br /&#62;
&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;Both lcd and serialUSB display 252 !&#60;br /&#62;
Displaying an int directly works :&#60;br /&#62;
&#60;code&#62;&#60;br /&#62;
int value;&#60;br /&#62;
value = -4;&#60;br /&#62;
lcd-&#38;gt;print(value);&#60;br /&#62;
SerialUSB.println(value);&#60;br /&#62;
&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;I then can see a nice -4.&#60;/p&#62;
&#60;p&#62;Does anyone have an idea ?&#60;/p&#62;
&#60;p&#62;Thanks,&#60;/p&#62;
&#60;p&#62;Xavier
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
