{"id":353,"date":"2012-10-15T18:47:28","date_gmt":"2012-10-15T18:47:28","guid":{"rendered":"https:\/\/raspberry-projects.com\/pi\/?p=353"},"modified":"2020-01-13T22:51:28","modified_gmt":"2020-01-13T22:51:28","slug":"variables","status":"publish","type":"post","link":"https:\/\/raspberry-projects.com\/pi\/programming-in-c\/memory\/variables","title":{"rendered":"Variables"},"content":{"rendered":"<h5>For Raspberry Pi with a 32-bit processor<\/h5>\n<table style=\"width: 600px;\" border=\"0\" cellspacing=\"1\" cellpadding=\"1\">\n<tbody>\n<tr>\n<td><strong>Name<\/strong><\/td>\n<td style=\"text-align: center;\"><strong>C++<\/strong><\/td>\n<td style=\"text-align: center;\"><strong>Bytes<\/strong><\/td>\n<td><strong>Range<\/strong><\/td>\n<\/tr>\n<tr>\n<td>bool<\/td>\n<td style=\"text-align: center;\"><\/td>\n<td style=\"text-align: center;\">1<\/td>\n<td>true or false<\/td>\n<\/tr>\n<tr>\n<td>signed char<\/td>\n<td style=\"text-align: center;\">int8_t<\/td>\n<td style=\"text-align: center;\">1<\/td>\n<td>-128 to 127<\/td>\n<\/tr>\n<tr>\n<td>unsigned char<\/td>\n<td style=\"text-align: center;\">uint8_t<\/td>\n<td style=\"text-align: center;\">1<\/td>\n<td>0 to 255<\/td>\n<\/tr>\n<tr>\n<td>short int<\/td>\n<td style=\"text-align: center;\">int16_t<\/td>\n<td style=\"text-align: center;\">2<\/td>\n<td>-32768 to 32767<\/td>\n<\/tr>\n<tr>\n<td>unsigned\u00a0short int<\/td>\n<td style=\"text-align: center;\">uint16_t<\/td>\n<td style=\"text-align: center;\">2<\/td>\n<td>0 to 65535<\/td>\n<\/tr>\n<tr>\n<td>int<\/td>\n<td style=\"text-align: center;\">int32_t<\/td>\n<td style=\"text-align: center;\">4<\/td>\n<td>-2147483648 to 2147483647<\/td>\n<\/tr>\n<tr>\n<td>unsigned int<\/td>\n<td style=\"text-align: center;\">uint32_t<\/td>\n<td style=\"text-align: center;\">4<\/td>\n<td>0 to 4294967295<\/td>\n<\/tr>\n<tr>\n<td>long\u00a0int<\/td>\n<td style=\"text-align: center;\">int32_t<\/td>\n<td style=\"text-align: center;\">4<\/td>\n<td>-2147483648 to 2147483647<\/td>\n<\/tr>\n<tr>\n<td>unsigned\u00a0long\u00a0int<\/td>\n<td style=\"text-align: center;\">uint32_t<\/td>\n<td style=\"text-align: center;\">4<\/td>\n<td>0 to 4294967295<\/td>\n<\/tr>\n<tr>\n<td>long long<\/td>\n<td style=\"text-align: center;\">int64_t<\/td>\n<td style=\"text-align: center;\">8<\/td>\n<td>\u22129,223,372,036,854,775,808 to 9,223,372,036,854,775,807<\/td>\n<\/tr>\n<tr>\n<td>unsigned long long<\/td>\n<td style=\"text-align: center;\">uint64_t<\/td>\n<td style=\"text-align: center;\">8<\/td>\n<td>0 to 18,446,744,073,709,551,615<\/td>\n<\/tr>\n<tr>\n<td>float<\/td>\n<td style=\"text-align: center;\"><\/td>\n<td style=\"text-align: center;\">4<\/td>\n<td>+\/- 3.4e +\/- 38 (~7 digits)<\/td>\n<\/tr>\n<tr>\n<td>double<\/td>\n<td style=\"text-align: center;\"><\/td>\n<td style=\"text-align: center;\">8<\/td>\n<td>+\/- 1.7e +\/- 308 (~15 digits)<\/td>\n<\/tr>\n<tr>\n<td>long double<\/td>\n<td style=\"text-align: center;\"><\/td>\n<td style=\"text-align: center;\">8<\/td>\n<td>+\/- 1.7e +\/- 308 (~15 digits)<\/td>\n<\/tr>\n<tr>\n<td>wchar_t<\/td>\n<td style=\"text-align: center;\"><\/td>\n<td style=\"text-align: center;\">2 or 4<\/td>\n<td>1 wide character<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h5>For Raspberry Pi with a 64-bit processor<\/h5>\n<table style=\"width: 600px;\" border=\"0\" cellspacing=\"1\" cellpadding=\"1\">\n<tbody>\n<tr>\n<td><strong>Name<\/strong><\/td>\n<td style=\"text-align: center;\"><strong>C++<\/strong><\/td>\n<td style=\"text-align: center;\"><strong>Bytes<\/strong><\/td>\n<td><strong>Range<\/strong><\/td>\n<\/tr>\n<tr>\n<td>bool<\/td>\n<td style=\"text-align: center;\"><\/td>\n<td style=\"text-align: center;\">1<\/td>\n<td>true or false<\/td>\n<\/tr>\n<tr>\n<td>signed char<\/td>\n<td style=\"text-align: center;\">int8_t<\/td>\n<td style=\"text-align: center;\">1<\/td>\n<td>-128 to 127<\/td>\n<\/tr>\n<tr>\n<td>unsigned char<\/td>\n<td style=\"text-align: center;\">uint8_t<\/td>\n<td style=\"text-align: center;\">1<\/td>\n<td>0 to 255<\/td>\n<\/tr>\n<tr>\n<td>short int<\/td>\n<td style=\"text-align: center;\">int16_t<\/td>\n<td style=\"text-align: center;\">2<\/td>\n<td>-32768 to 32767<\/td>\n<\/tr>\n<tr>\n<td>unsigned\u00a0short int<\/td>\n<td style=\"text-align: center;\">uint16_t<\/td>\n<td style=\"text-align: center;\">2<\/td>\n<td>0 to 65535<\/td>\n<\/tr>\n<tr>\n<td>int<\/td>\n<td style=\"text-align: center;\">int64_t<\/td>\n<td style=\"text-align: center;\">8<\/td>\n<td>\u22129,223,372,036,854,775,808 to 9,223,372,036,854,775,807<\/td>\n<\/tr>\n<tr>\n<td>unsigned int<\/td>\n<td style=\"text-align: center;\">uint64_t<\/td>\n<td style=\"text-align: center;\">8<\/td>\n<td>0 to 18,446,744,073,709,551,615<\/td>\n<\/tr>\n<tr>\n<td>long\u00a0int<\/td>\n<td style=\"text-align: center;\">int64_t<\/td>\n<td style=\"text-align: center;\">8<\/td>\n<td>\u22129,223,372,036,854,775,808 to 9,223,372,036,854,775,807<\/td>\n<\/tr>\n<tr>\n<td>unsigned\u00a0long\u00a0int<\/td>\n<td style=\"text-align: center;\">uint64_t<\/td>\n<td style=\"text-align: center;\">8<\/td>\n<td>0 to 18,446,744,073,709,551,615<\/td>\n<\/tr>\n<tr>\n<td>long long<\/td>\n<td style=\"text-align: center;\">int64_t<\/td>\n<td style=\"text-align: center;\">8<\/td>\n<td>\u22129,223,372,036,854,775,808 to 9,223,372,036,854,775,807<\/td>\n<\/tr>\n<tr>\n<td>unsigned long long<\/td>\n<td style=\"text-align: center;\">uint64_t<\/td>\n<td style=\"text-align: center;\">8<\/td>\n<td>0 to 18,446,744,073,709,551,615<\/td>\n<\/tr>\n<tr>\n<td>float<\/td>\n<td style=\"text-align: center;\"><\/td>\n<td style=\"text-align: center;\">4<\/td>\n<td>+\/- 3.4e +\/- 38 (~7 digits)<\/td>\n<\/tr>\n<tr>\n<td>double<\/td>\n<td style=\"text-align: center;\"><\/td>\n<td style=\"text-align: center;\">8<\/td>\n<td>+\/- 1.7e +\/- 308 (~15 digits)<\/td>\n<\/tr>\n<tr>\n<td>long double<\/td>\n<td style=\"text-align: center;\"><\/td>\n<td style=\"text-align: center;\">8<\/td>\n<td>+\/- 1.7e +\/- 308 (~15 digits)<\/td>\n<\/tr>\n<tr>\n<td>wchar_t<\/td>\n<td style=\"text-align: center;\"><\/td>\n<td style=\"text-align: center;\">2 or 4<\/td>\n<td>1 wide character<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>For Raspberry Pi with a 32-bit processor Name C++ Bytes Range bool 1 true or false signed char int8_t 1 -128 to 127 unsigned char uint8_t 1 0 to 255 short int int16_t 2 -32768 to 32767 unsigned\u00a0short int uint16_t 2 0 to 65535 int int32_t 4 -2147483648 to 2147483647 unsigned int uint32_t 4 0 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[],"class_list":["post-353","post","type-post","status-publish","format-standard","hentry","category-memory"],"_links":{"self":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/353","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/comments?post=353"}],"version-history":[{"count":9,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/353\/revisions"}],"predecessor-version":[{"id":3135,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/posts\/353\/revisions\/3135"}],"wp:attachment":[{"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/media?parent=353"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/categories?post=353"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/raspberry-projects.com\/pi\/wp-json\/wp\/v2\/tags?post=353"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}