码迷,mamicode.com
首页 >  
搜索关键字:printf    ( 15030个结果
fuelSources
function countdown() { local i; sleep 1 for ((i=$1 - 1;i>=1;i--));do printf '\b\b%02d' "$i" sleep 1 done}export LANG=en_US.UTF8;if [ -f /root/.showf.....
分类:其他好文   时间:2014-07-09 21:00:48    阅读次数:197
scanf printf gets() puts(),cin cout
最近在练机试题,常用的C和C++输入输出如下:1 scanf 和printfint a; scanf("%d",&a) ; printf("%d",a); printf("\n");double b;scanf("%");char c; scanf("%c",&c);printf("%c",c);l...
分类:其他好文   时间:2014-07-08 22:53:52    阅读次数:257
转载:用vector保存对象时保存指针的优点, 以及reserve的使用
#include #include class A{public: A() { printf("A()/n"); } ~A() { printf("~A()/n"); } A(const A& other) { ...
分类:其他好文   时间:2014-07-06 20:44:00    阅读次数:152
C primer plus 练习题 第三章
5. 1 #include 2 3 int main() 4 { 5 float you_sec; 6 printf("请输入你的年龄:"); 7 scanf("%f", &you_sec); 8 printf("年龄合计:%e 秒!\n", you_sec * ...
分类:其他好文   时间:2014-07-06 16:24:54    阅读次数:162
linux内核中驱动开发常见的相似多态
#include#includestruct test{ char name[20]; void (*func)(char *);};void tttfunc(char *name){ printf("current is %d\n",__LINE__); printf("%s\n",name);}...
分类:系统相关   时间:2014-07-06 15:44:49    阅读次数:223
c语言中读入带空格的字符串
问题:  scanf("%s", a); 运行输入hello world   回车 则输入到a的只是空格之前的部分,怎样把空格之后的部分也输出? 1. scanf( "%[^\n]", str ); #include int main(){ char str[50]; scanf( "%[^\n]", str ); printf( "%s\...
分类:编程语言   时间:2014-07-06 11:05:52    阅读次数:211
对两个奇葩的C语言程序的思考
两个奇葩的C语言程序 #include #include void main(int i) { printf("%d\n", i); (&main + (&exit - &main)*(i/1000))(i+1); }...
分类:编程语言   时间:2014-07-06 08:49:11    阅读次数:359
冒泡排序
//冒泡是相邻的两个数比较 void bubble_sort_low(int unsorted[], int count) //低级 {     for (int i = 0; i1; i++) { //比较的趟数         printf("-----------------\n");         for (int j=0; j1-i; j++) {          ...
分类:其他好文   时间:2014-07-06 00:35:49    阅读次数:291
Obj-C数组以及字符串拼接与分割
Obj-C只是增加了一点“特殊语料”的C语言,所以可以用printf()代替NSLog()。但我们建议使用NSLog,因为它添加了特性,例如时间戳,日期戳和自动附加换行符(‘\n’)等。1.OC的数组成员是任意的对象指针 与C中的链表结构类似(以nil结尾) 一切的数组操作不能越界OC的数组分为.....
分类:其他好文   时间:2014-07-05 22:33:03    阅读次数:341
可变参数函数
一、什么是可变参数  我们在C语言编程中有时会遇到一些参数个数可变的函数,例如printf()函数,其函数原型为:  int printf( const char* format, ...);  它除了有一个参数format固定以外,后面跟的参数的个数和类型是可变的(用三个点“…”做参数占位符),实际调用时可以有以下的形式:  printf("%d",i);  printf("%s",s...
分类:其他好文   时间:2014-07-05 10:38:06    阅读次数:199
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!