B
B
BonBon Slick2017-02-13 20:07:48
Programming
BonBon Slick, 2017-02-13 20:07:48

How much memory does a space character take?

So I write code like this, I have a lot of spaces and often ask myself this question, how much space does the space character take?

function ( $a ) {
...
//или
function($a){
...

I understand that it is necessary to write documented and readable code, so I always take something in between
/** super-duper function [ calculates whatever] 
* $a our whatever
* return ERROR
*/
function($a)
{...

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Saboteur, 2017-02-13
@BonBonSlick

in UTF-16 two bytes
in UTF-8/cp1251/KOI8/CP866 one byte.
In the compiled program, your spaces will not be present at all.

W
Wexter, 2017-02-13
@Wexter

1 byte

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question