From WikiChip
Editing c/data types

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

This page supports semantic in-text annotations (e.g. "[[Is specified as::World Heritage Site]]") to build structured and queryable content provided by Semantic MediaWiki. For a comprehensive description on how to use annotations or the #ask parser function, please have a look at the getting started, in-text annotation, or inline queries help pages.

Latest revision Your text
Line 1: Line 1:
{{c title|Data Types}}
+
{{C Guide}}
The meaning of a value stored in an {{C|variables|object}} is determined solely by the '''type''' of the expression used to access it - for example the type used in the {{C|variables#Variable Declaration|variable declaration}}. There are two categories of types:
+
The meaning of a value stored in an [[Variables - C|object]] is determined solely by the '''type''' of the expression used to access it - for example the type used in the [[Variables - C#Variable Declaration|variable declaration]]. There are two categories of types:
  
 
* '''object types''' - types used to describe objects
 
* '''object types''' - types used to describe objects
Line 21: Line 21:
 
| signed char || Same as char, guaranteed to be signed. || SCHAR_MIN || -127 || SCHAR_MAX || +127
 
| signed char || Same as char, guaranteed to be signed. || SCHAR_MIN || -127 || SCHAR_MAX || +127
 
|-
 
|-
| unsigned char || Same as char, guaranteed to be unsigned. || || 0 || UCHAR_MAX || +255
+
| unsigned char || Same as char, guaranteed to be unsigned. || 0 || UCHAR_MAX || +255
 
|}
 
|}
  
Line 68: Line 68:
 
|}
 
|}
  
The macros in the table can be found in the {{C|limits.h|<limits.h>}} header.
+
The macros in the table can be found in the [[limits.h|<limits.h>]] header.
  
 
=== Extended Unsigned/Signed Integer Types ===
 
=== Extended Unsigned/Signed Integer Types ===
Line 90: Line 90:
 
The '''void type''' comprises an empty set of values. The void type is an [[incomplete type - C|incomplete type]] which cannot be completed.  
 
The '''void type''' comprises an empty set of values. The void type is an [[incomplete type - C|incomplete type]] which cannot be completed.  
  
* float {{C|_Complex}}
+
* float [[_Complex]]
 
* double _Complex
 
* double _Complex
 
* long double _Complex
 
* long double _Complex
Line 97: Line 97:
 
Starting with C99, the C Standard introduced the '''_Bool''' type - an object large enough to store the values 0 and 1.
 
Starting with C99, the C Standard introduced the '''_Bool''' type - an object large enough to store the values 0 and 1.
  
The standard also introduced a new header: {{C|stdbool.h|<stdbool.h>}}. It is recommended that the header be used wherever the use of bool is needed instead of using _Bool directly. The header defines 4 macros:
+
The standard also introduced a new header: [[stdbool.h|<stdbool.h>]]. It is recommended that the header be used wherever the use of bool is needed instead of using _Bool directly. The header defines 4 macros:
  
 
* bool - expands to _Bool
 
* bool - expands to _Bool

Please note that all contributions to WikiChip may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see WikiChip:Copyrights for details). Do not submit copyrighted work without permission!

Cancel | Editing help (opens in new window)