c++ 格式化printf

类型为uint64_t的变量,使用printf进行打印时,需要区分操作系统:
64位系统:使用%ld
32位系统:使用%llu


#include<stdio.h>
#include <iostream>

int64_t a = 9102928374747474;

int main(void) {
    std::cout << a << std::endl;

    printf("%lld\n", a);  
}

 

posted on 2015-11-05 11:21  雨渐渐  阅读(674)  评论(0编辑  收藏  举报

导航