Difference between revisions of "Character and string types"

From Lazarus wiki
Jump to navigationJump to search
Line 37: Line 37:
 
* [http://www.freepascal.org/docs-html/ref/refsu16.html FPC PChar documentation]
 
* [http://www.freepascal.org/docs-html/ref/refsu16.html FPC PChar documentation]
  
 +
== PWideChar ==
 +
 +
A variable of type PWideChar is a pointer to a [[#WideChar|WideChar]] variable.
  
 
[[Category: FPC]]
 
[[Category: FPC]]
 +
[[Category: RTL]]
 
[[Category: Data types]]
 
[[Category: Data types]]

Revision as of 16:03, 28 December 2013

Free Pascal supports several types of characters and strings.

AnsiChar

A variable of type AnsiChar is exactly 1 byte in size, and contains one ASCII character.

a

Reference

WideChar

A variable of type WideChar is exactly 2 bytes in size, and contains one Unicode character in UTF-16 encoding.

a

Reference

PChar

A variable of type PChar is basically a pointer to a Char type, but allows additional operations. PChars can be used to access C-style null-terminated strings, e.g. in interaction with certain OS libraries or third-party software.

a b c #0

Reference

PWideChar

A variable of type PWideChar is a pointer to a WideChar variable.