Idris 语言文档 Version 1.3.1奥 奮 奵 女 奩 奮 奧 奴 奨 奥 Effects 奬 奩 奢 奲 奡奲 她 夺 module Main import Effects import Effect.StdIO hello : Eff () [STDIO] hello = putStrLn "Hello world!" main : IO () main = run hello 奁女 奵 女 奵 奡奬 夬 奴 奨 奥 奥 main央 奁奬 奬 main 奨 奡女 奴 奯 奤 奯 奩 女 奩 奮 奶 奯奫 奥 奴 奨 奥 hello 奦 奵 奮 奣 奴 奩 奯奮 奷 奨 奩 奣 奨 女 奵 奰 奰 奯奲 奴 女 奴 奨 奥 STDIO 奥 夛 奥 奣 奴 奦 奯奲 奣 奯奮 女 奯奬 奥 奉 夯奏 夬 奡奮 奤 奲 奥 奴 奵 奲 奮 女 奴 奨 奥 奵 奮 奩 奴 奶 奡奬 奵 奥 央 奁奬 奬 奰 奲 奯奧奲 奡奭 女 奵 r y 夨 姩 妡妵 失夳夳天 央 4. 3. 1 C on s ol e I /O 奃 奯奮 女 奯奬 奥 奉 夯奏 奩 女 女 奵 奰 奰 奯奲 奴 奥 奤 奷 奩 奴 奨 奴 奨 奥 STDIO 奥 夛 奥 奣 奴 夬 奷 奨 奩 奣 奨 奡奬 奬 奯奷 女 奲 奥 奡奤 奩 奮 奧 奡奮 奤 奷 奲 奩 奴 奩 奮 奧 奣 奨 奡奲 奡奣 奴 奥 奲 女 奡奮 奤 女 奴 奲 奩 奮 奧女0 码力 | 224 页 | 2.06 MB | 1 年前3
Debian 维护者指南hello.c 16 CHAPTER 4. 简单例子 4.6. 第二步:使用 DEBMAKE 产生模板文件 $ cat debhello-0.0/src/hello.c #include <stdio.h> int main() { printf("Hello, world!\n"); return 0; } 这里,源码中的 Makefile 支持 GNU 编码标准 和 FHS(文件系统层级规范)。特别地: src/hello.c(v=1.4): $ cat debhello-1.4/src/hello.c #include "config.h" #include#include <stdio.h> int main() { printf("Hello, I am " PACKAGE_AUTHOR "!\n"); printf("4.0 * atan(1.0) = %10f8\n", debhello-1.5/src/hello.c #include "config.h" #ifdef WITH_MATH # include #endif #include <stdio.h> int main() { printf("Hello, I am " PACKAGE_AUTHOR "!\n"); #ifdef WITH_MATH printf("4.0 * atan(1 0 码力 | 142 页 | 1.11 MB | 1 年前3
1 Beautiful Python#include <stdio.h> int main(int argc, char *argv[]) { for(int i = 0; i < argc; i++) printf("%s\n", argv[i]); return 0; } A SIMPLE PROGRAM IN C 10 #include <stdio.h> int main(int 13 import sys for arg in sys.argv: print arg PYTHON: A MODERNIST LANGUAGE 14 #include <stdio.h> int main(int argc, char *argv[]) { for(int i = 0; i < argc; i++) printf("%s\n"0 码力 | 109 页 | 34.99 MB | 1 年前3
Bootarmor 入门教程和用户手册 0.1.0问,就需要进行一些额外的设置和处理。 默认情况下,代码段,数据段,字符串常量是被保护的,而内存堆,运行栈和 数据文件是没 有被保护的。 例如,在默认编译链接选项下面 #include#include <stdio.h> #include // 全局变量存放被保护 int ga; int gb = 1; static int sa; static int sb = 2; // 字符串常量 open 需要把文件名称传递到内核,下面 这个示例中默认模式下 是无法正常运行的,因为字符串常量默认是处于保护 模式,无法被内核访问。 #include #include <stdio.h> #include char *filename1 = "data1.txt"; int main(int argc, char *argv[]) { int 会被存 放到当前函数的运行栈中,而运行栈默认情况是允许内核访问的,从 而避免内核无法访问字 符串的问题。下面的例子就可以解决上面的问题 #include #include <stdio.h> #include #include "btapp.h" int main(int argc, char *argv[]) { int fd; fd 0 码力 | 25 页 | 30.29 KB | 1 年前3
Bootarmor 入门教程和用户手册 0.1.0栈和数据文件是没有被保护的。 例如,在默认编译链接选项下面 15 Bootarmor 入门教程和用户手册, 发布 0.1.0 #include#include <stdio.h> #include // 全 局 变 量 存 放 被 保 护 int ga; int gb = 1; static int sa; static int sb open 需要把文件名称传递到内核,下面这个示例中默认模式下是无法正常运行的,因为字符串常量 默认是处于保护模式,无法被内核访问。 #include #include <stdio.h> #include char *filename1 = "data1.txt"; int main(int argc, char *argv[]) { int 声明字符串常量。这种字符串会被存放到当前函数的运行栈 中,而运行栈默认情况是允许内核访问的,从而避免内核无法访问字符串的问题。下面的例子就可以解决上 面的问题 #include #include <stdio.h> #include #include "btapp.h" int main(int argc, char *argv[]) { int fd; fd = open(BTS("data 0 码力 | 29 页 | 300.11 KB | 1 年前3
Nim 2.0.2 中文手册x[i] 可⽤于访问 x 的第 i 个元素。 proc printf(formatstr: cstring) {.importc: "printf", varargs, header: "<stdio.h>".} printf("这会%s⼯作", "像预期⼀样") var str: string = "Hello!" var cstr: cstring = str var newstr: importc, nodecl.}: cint # 把 EACCES 假装成变量, # Nim 不知道它的值 type PFile {.importc: "FILE*", header: "<stdio.h>".} = distinct pointer # 引⼊ C 的 FILE* 类型;Nim 把它视为⼀个新的指针类型 注意: LLVM 后端不存在这种编译指示。 IncompleteStruct (int)""", nimVar, ");"].} {.pop.} embedsC() proc foobar() {.importc:"$1".} {.emit: """ #include <stdio.h> NIM_EXTERNC void fun(){} """.} {.emit: """/*TYPESECTION*/ struct Vector3 { public: Vector3():0 码力 | 127 页 | 7.05 MB | 1 年前3
Cmake 实践mkdir t1 cd t1 在 t1 目录建立 main.c 和 CMakeLists.txt(注意文件名大小写): main.c 文件内容: //main.c #include <stdio.h> int main() { printf(“Hello World from t1 Main!\n”); return 0; } CmakeLists.txt 文件内容: PROJECT HelloFunc() { printf(“Hello World\n”); } hello.h 内容如下: #ifndef HELLO_H #define HELLO_H #include <stdio.h> void HelloFunc(); #endif 在 lib 目录下建立 CMakeLists.txt,内容如下: SET(LIBHELLO_SRC hello.c) ADD_LIBRARY(hello 在/backup/cmake 目录建立 t5 目录,用于存放我们的 CURL 的例子。 建立 src 目录,并建立 src/main.c,内容如下: #include#include <stdio.h> #include #include FILE *fp; int write_data(void *ptr, size_t size, size_t 0 码力 | 47 页 | 264.27 KB | 1 年前3
Julia 中文文档. . . . . . . . 1196 92.15printf() and stdio in the Julia runtime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1200 Libuv wrappers for stdio . . . . . . . . . . . . . . . . . . . . other part of the system. source open(command, mode::AbstractString, stdio=devnull) Run command asynchronously. Like open(command, stdio; read, write) except specifying the read and write flags via a mode write read = true, write = true w+ read, write read = true, write = true source open(command, stdio=devnull; write::Bool = false, read::Bool = !write) Start running command asynchronously, and return0 码力 | 1238 页 | 4.59 MB | 1 年前3
Hello 算法 1.0.0 C语言版请注意,删除元素完成后,原先末尾的元素变得“无意义”了,所以我们无须特意去修改它。 // === File: array.c === /* 删除索引 index 处的元素 */ // 注意:stdio.h 占用了 remove 关键词 void removeItem(int *nums, int size, int index) { // 把索引 index 之后的所有元素向前移动一位 for ,这意味着 P 已 经不再属于该链表了。 图 4‑7 链表删除节点 // === File: linked_list.c === /* 删除链表的节点 n0 之后的首个节点 */ // 注意:stdio.h 占用了 remove 关键词 void removeItem(ListNode *n0) { if (!n0->next) return; // n0 -> P -> n1 ListNode nums->arr[i] = nums->arr[i - 1]; } nums->arr[index] = num; nums->size++; } /* 删除元素 */ // 注意:stdio.h 占用了 remove 关键词 int removeItem(MyList *nums, int index) { assert(index >= 0 && index < size(nums));0 码力 | 390 页 | 17.63 MB | 1 年前3
Hello 算法 1.1.0 C语言版请注意,删除元素完成后,原先末尾的元素变得“无意义”了,所以我们无须特意去修改它。 // === File: array.c === /* 删除索引 index 处的元素 */ // 注意:stdio.h 占用了 remove 关键词 void removeItem(int *nums, int size, int index) { // 把索引 index 之后的所有元素向前移动一位 for ,这意味着 P 已 经不再属于该链表了。 图 4‑7 链表删除节点 // === File: linked_list.c === /* 删除链表的节点 n0 之后的首个节点 */ // 注意:stdio.h 占用了 remove 关键词 void removeItem(ListNode *n0) { if (!n0->next) return; // n0 -> P -> n1 ListNode nums->arr[i] = nums->arr[i - 1]; } nums->arr[index] = num; nums->size++; } /* 删除元素 */ // 注意:stdio.h 占用了 remove 关键词 int removeItem(MyList *nums, int index) { assert(index >= 0 && index < size(nums));0 码力 | 391 页 | 18.51 MB | 1 年前3
共 113 条
- 1
- 2
- 3
- 4
- 5
- 6
- 12













