タグ

ポインタに関するtasanobuのブックマーク (2)

  • Interacting with C Pointers - Swift Blog

    Swift is now open source. For the latest news, visit the Swift open source blog Objective-C and C APIs often require the use of pointers. Data types in Swift are designed to feel natural when working with pointer-based Cocoa APIs, and Swift automatically handles several of the most common use cases for pointers as arguments. In this post we’ll look at how pointer parameters in C can be used with t

    Interacting with C Pointers - Swift Blog
    tasanobu
    tasanobu 2014/07/29
    Swiftで開発するにしても、まだまだC言語の知識は必要だな〜 CocoaがSwiftで書き直される日が待ち遠しい
  • Cでのポインタの読み方

    Cでのポインタの読み方 Cのポインタの読み方は、ルールを知らないと摩訶不思議です。 ルールを覚えれば、 int (*p[5])[3]; char (*(*fp)(void))(int); なんてのも解読する事ができます。 大事な前程 ポインタを読む際には、「英語で読む」必要があります。 「え~、英語~」 と思う方もいるかもしれませんが、逆に日語で読む方が大変です。 基ルール ルール 後置演算子が優先。 関数の() 配列の[] 前置はあとで。 要は、「後ろに何かあったら、後ろが優先」です。 演算子の英語での読み方 * pointer to ... () function returning ... [] array of ... Lesson 1 まず、演算子が単独で出てくる場合です。 Lesson 1-1 pointer to ... int *p; これは、まずpを見ましょう。 i

  • 1