#[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. JDBC2

    1.JDBC连接池 public class JdbcTemplateDemo2 { //Junit单元测试,可以让方法独立执行 //1. 获取JDBCTemplate对象 private JdbcT ...

  2. 关于swiper 4的coverflowEffect(3d)

    轮播效果: HTML: <div class="swiper-container successful_swiper"> <div class="swi ...

  3. 修改MySQL表中自增编号

    alter table 表名 AUTO_INCREMENT = 值 例:

  4. Linux排查磁盘空间顺序解决空间不足问题

    1 先查看整个磁盘的情况 df    -h                     查看整台服务器的硬盘使用情况 cd    /                       进入根目录 du   -s ...

  5. Dubble 01 架构模型&start project

    Dubbo 01 架构模型 传统架构 All in One 测试麻烦,微小修改 全都得重新测 单体架构也称之为单体系统或者是单体应用.就是一种把系统中所有的功能.模块耦合在一个应用中的架构方式.其优点 ...

  6. Transformer, ELMo, GPT, 到Bert

    RNN:难以并行 CNN:filter只能考虑局部的信息,要叠多层 Self-attention:可以考虑全局的信息,并且可以并行 (Attention Is All You Need) 示意图:x1 ...

  7. pthread_cond_wait

    while(1) 33 { 34 mm* p = NULL; 35 pthread_mutex_lock(&mutex); 36 while(head == NULL) 37 pthread_ ...

  8. [uboot] (番外篇)uboot relocation介绍(转)

    版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明.本文链接:https://blog.csdn.net/ooonebook/article/det ...

  9. Centos7基础优化操作项

    1.基础优化操作项:更新yum源信息第一个:就近使用yum源地址,安装软件更快.curl -s -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors. ...

  10. CAP拾遗

    概念 在一个分布式系统(指互相连接并共享数据的节点的集合)中,当涉及读写操作时,只能保证一致性.可用性.分区容错性三者中的两个,另外一个必须被牺牲 Consistency 对某个指定的客户端来说,读操 ...