This article's documentation is for anything that uses the Source engine. Click here for more information.

Byte: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
mNo edit summary
 
No edit summary
 
(26 intermediate revisions by 17 users not shown)
Line 1: Line 1:
In SDK code, '''byte''' refers to an eight-bit byte. It represents one of 256 possible [[integer|integral]] values. These values can be used for calculations and can lower the amount of data networked.
{{Source topicon}}
{{LanguageBar}}
A {{wiki|byte}} is eight {{wiki|bits}}, the size of one [[char]]. A kilobyte (KB) is 1024 bytes, while a megabyte (MB) is 1024 kilobytes, a gigabyte (GB) is 1024 megabytes, etc.
 
A byte is the minimum amount of memory allocatable. Even a [[bool]] is one byte (thus the benefits of [[BitVec]]{{clarify}}).
 
* In {{goldsrc|4}} and {{src|4}}, {{code|byte}} is a typedef for {{code|unsigned char}}, making its range 0-255.
 
[[Category:Variables]]
[[Category:Source]]

Latest revision as of 14:41, 28 May 2025

English (en)Deutsch (de)中文 (zh)Translate (Translate)

A Wikipedia icon byte is eight Wikipedia icon bits, the size of one char. A kilobyte (KB) is 1024 bytes, while a megabyte (MB) is 1024 kilobytes, a gigabyte (GB) is 1024 megabytes, etc.

A byte is the minimum amount of memory allocatable. Even a bool is one byte (thus the benefits of BitVec[Clarify]).

  • In GoldSrc GoldSrc and Source Source, byte is a typedef for unsigned char, making its range 0-255.