"함수 define()"의 두 판 사이의 차이

20번째 줄: 20번째 줄:
==PHP==
==PHP==
[[category:PHP]]
[[category:PHP]]
<source lang='php'>
define('PI', 3.14159265358979323846);
</source>
<source lang='php'>
<source lang='php'>
define('NAME', 'John');
define('NAME', 'John');

2017년 8월 12일 (토) 21:05 판

1 C

#define PI 3.14159265358979323846
#define NAME "John"
...
printf("Hello, %s!", NAME);
// Hello, John!

2 Java

public static final double PI = 3.141592653589793;

3 PHP

define('PI', 3.14159265358979323846);
define('NAME', 'John');
echo 'Hello, ' . NAME . '!';
// Hello, John!

4 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}