#[link(name = "c")]
extern "C" {
fn scanf(format: *const u8, ...);
} fn main() {
let mut a = ;
let mut b = ;
unsafe {
scanf("%d%d\0".as_ptr(), &mut a, &mut b);
}
println!("{}", a + b);
}

Rust Linking With C Library Functions的更多相关文章

  1. [Linux C]系统调用(system call)和库函数调用(Library functions)

    Linux 下对文件操作有两种方式:系统调用(system call)和库函数调用(Library functions).系统调用实际上就是指最底层的一个调用,在 linux 程序设计里面就是底层 调 ...

  2. Objective-C categories in static library

    ASK: Can you guide me how to properly link static library to iphone project. I use staic library pro ...

  3. C-Language Functions

    转自:https://www.postgresql.org/docs/9.6/xfunc-c.html 可以作为学习基于c编写pg extension 的资料 36.9. C-Language Fun ...

  4. 动态链接库(Dynamic Link Library)

    DLL INTRODUCTION A DLL is a library that contains code and data that can be used by more than one pr ...

  5. python3.4 build in functions from 官方文档 翻译中

    2. Built-in Functions https://docs.python.org/3.4/library/functions.html?highlight=file The Python i ...

  6. Brief Tour of the Standard Library

    10.1. Operating System Interface The os module provides dozens of functions for interacting with the ...

  7. [算法]A General Polygon Clipping Library

    A General Polygon Clipping Library Version 2.32    http://www.cs.man.ac.uk/~toby/alan/software/gpc.h ...

  8. 5.24 Declaring Attributes of Functions【转】

    转自:https://gcc.gnu.org/onlinedocs/gcc-4.0.0/gcc/Function-Attributes.html 5.24 Declaring Attributes o ...

  9. iOS在Cocoa Touch Static Library使用CocoaPods

    1.在XCode中新建静态库工程:DDLogLib. 2.添加对外暴露接口的头文件DDLogLibHeader.h 3.命令行进入DDLogLib目录,运行pod init,并修改Podfile 4. ...

随机推荐

  1. 原生JS+CSS实现日期插件

    笔者最近在学习Element UI,觉得它提供的日期选择器既简单又美观,于是仿照着写了一个日期插件.笔者使用到的技术有ES5.CSS和HTML,控件兼容IE10+和谷歌浏览器.有一点需要注意,笔者使用 ...

  2. 设置Linux之CentOS7的网络的两种方式动态IP+静态IP

    1 动态IP 参考之前的文章 点击进入 2 静态IP vi /etc/sysconfig/network-scripts/ifcfg-ens33 详情配置如下,上面半部分是我之前的动态IP的设置 静态 ...

  3. python中的定时任务

    使用threading模块中的Timer函数 from threading import Timer import time def execute_func(name, age, gender, h ...

  4. vmware虚拟机安装centos7.3

    vmware准备 CentOS准备,这里下载的是CentOS 7.3CentOS-7-x86_64-Everything-1611.iso 创建新的虚拟机 选择自定义安装 硬件兼容性默认最新的,不用动 ...

  5. Arch Linux 安装 ibus-rime

    参考网站 default.custom.yaml 在方案選單中添加五筆.雙拼 rime-wubi 操作方式 # 删除原rime(可选) sudo pacman -Rs ibus-rime ibus-t ...

  6. .htaccess 一段神奇的跳转代码

    <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{HTTP_REFERER} ^.*(google|ask|yahoo|you ...

  7. 高性能mysql 第11章 可扩展的mysql

    可扩展性的定义:当增加资源以获得执行更多的工作系统能获得划算的同等提升. 向上扩展(垂直扩展):提升服务器的硬件性能. 向外扩展(水平扩展):一般都是复制,拆分,数据分片(sharding). 复制: ...

  8. 优化oracle读写任务

    查读盘次数最多的前十个sql操作: SELECT * FROM (select PARSING_USER_ID, EXECUTIONS, SORTS, COMMAND_TYPE, DISK_READS ...

  9. k8s资源对象及API群组

    REST是representational state transfer的缩写,意为“表征状态转移”,它是一种程序架构风格,基本元素为资源(resource).表征(representation)和行 ...

  10. PHP---pdo和mongodb的操作使用

    <?php $pdo = new PDO("mysql:host=127.0.0.1;dbname=testdb","root","123456 ...