Skip to Content
Cクイックリファレンス 第2版
book

Cクイックリファレンス 第2版

by Peter Prinz, Tony Crawford, 黒川 利明, 島 敏博
November 2016
Beginner to intermediate
816 pages
19h 58m
Japanese
O'Reilly Japan, Inc.
Content preview from Cクイックリファレンス 第2版
270
15
章 プリプロセッサ指令
#define STR(s) #s //
この
#
は「文字列化」演算子
この定義を使うと、次の2行は等価だ。
#pragma
tokens
_Pragma (STR(
tokens
))
次の例は
_Pragma
演算子をマクロで使う。
#define ALIGNMENT(n) _Pragma(STR(pack(n)))
ALIGNMENT(2)
マクロ置き換えが
ALIGNMENT(2)
マクロ呼び出しを次に変更する。
_Pragma("pack(2)")
プリプロセッサがこの行を次の指令であるかのように処理する。
#pragma pack(2)
15.9
 定義済みマクロ
ISO C標準に適合するコンパイラはみな次の7つのマクロを定義しなければならない。こ
れらのマクロ名はいずれも最初と最後に下線文字2文字がつく。
__DATE__
置換テキストは形式
"Mmm dd yyyy"
(例
"Mar 19 2006"
)のコンパイルした日
付の文字列リテラルだ。月の日付が10より少ないと10の位には空白文字を
含む。
__FILE__
現在のソースファイルの名前の文字列リテラル。
__LINE__
ファイルの先頭からの
__LINE__
マクロ参照を含む現在のソースファイルの
行数である整数定数値。
__TIME__ "hh:mm:ss"
形式(例
"08:00:59"
)でコンパイル時刻を含む文字列リテラル。
__STDC__
コンパイラがISO C標準に適合することを示す整数定数1
__STDC_HOSTED__
現在の
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Rustの練習帳 ―コマンドラインツールの作成を通してRustを学ぶ

Rustの練習帳 ―コマンドラインツールの作成を通してRustを学ぶ

Ken Youens-Clark, 中山 光樹
Unityによるモバイルゲーム開発 ―作りながら学ぶ2D/3Dゲームプログラミング入門

Unityによるモバイルゲーム開発 ―作りながら学ぶ2D/3Dゲームプログラミング入門

Jon Manning, Paris Buttfield-Addison, 鈴木 久貴, あんどうやすし, 江川 崇, 安藤 幸央, 高橋 憲一

Publisher Resources

ISBN: 9784873117812Other