码迷,mamicode.com
首页 >  
搜索关键字:printf    ( 15030个结果
读取中文的标准C API
这个是在Linux下遇到的,以前从来都不需要支持中文,最近项目需要。 FILE *fp=NULL; fgets(buf, sizeof buf, fp); printf ("buf=%s\n", buf); 成功,就这样就满足我的需求了。 之前的弯路是fread()来读取,这个就太麻烦了,所以换了算法。...
分类:Windows程序   时间:2014-06-05 11:53:27    阅读次数:342
C语言零基础项目驱动式学习第二天
//BOOL 类型是一种非真即假的数据类型,取值只有YES和NO, //BOOL 其实是OC中得数据类型,在C语言中,认为非0即为真. //BOOL 类型规定的存储空间为一个字节.// BOOL a = YES;// BOOL b = NO;// printf("a = %d, b = ...
分类:编程语言   时间:2014-06-04 18:47:51    阅读次数:272
虚析构函数的作用
1class ITest 2{ 3public: 4virtual void Test() = 0; 5 6}; 7 8class CTest : public ITest 9{ 10 public: 11CTest(){ printf("constructor.n"); }; 12~CTest()...
分类:其他好文   时间:2014-06-03 11:38:25    阅读次数:314
linux shell设置颜色
使用echo或者printf时,可以添加输出文本的颜色设置echo -e "Maximum \e[1;31m" $max_threads "\e[0mthreads allowed!" >> $term_dir/summary或者printf("\033[;34mfile\033[0m")31开始代...
分类:系统相关   时间:2014-06-03 09:11:52    阅读次数:306
cuda核函数再调用核函数,多层并行
#include __global__ void childKernel(int i) { int tid = blockIdx.x*blockDim.x+threadIdx.x; printf("parent:%d,child:%d\n",i,tid); for(int j=i;j<i+10;j++) { printf(",%d",j); } printf("\n");...
分类:其他好文   时间:2014-06-03 03:58:15    阅读次数:206
C语言学习_test3
1.判断一个数是都是回文数 #include int main(void) { int a[100] = {0}; int n; printf("input n:"); scanf("%d", &n); int i, k, j; k = 0; j = 0; while(n != 0) { a[k++] = n % 10; n = n / 10; j+...
分类:编程语言   时间:2014-06-03 03:26:18    阅读次数:255
C语言学习_三分查找
三分查找: #include #define M 10 int main(void) { int front, near, mid1, mid2; int n; int found; int a[M] = {1, 2, 3, 4, 5, 6, 7, 8, 9}; front = 0; near = M - 1; found = 0; printf("input n:");...
分类:编程语言   时间:2014-06-03 01:38:47    阅读次数:399
相识多少天
#include int main(void){ int year1, month1, day1, midDay; int year2, month2, day2; int totalDate1; int totalDate2; printf("请输入两个日期 年 月 日\n"); scanf("%...
分类:其他好文   时间:2014-05-31 13:58:57    阅读次数:240
c语言之排序
冒泡排序,每次循环选出一个最大/最小的数在队伍的末端,循环n-1次 1 # include 2 3 int main (void) 4 { 5 int a[10]; 6 int i, j, t; 7 8 printf("请输入10个整数:"); 9 10 ...
分类:编程语言   时间:2014-05-30 03:10:52    阅读次数:336
linux平台上面python调用c
不能免俗,先打印个helloworld出来,c代码的函数hello.c#include int helloworld(){ printf("hello world!"); return 0;}然后编译成动态链接库 gcc hello.c -fPIC -shared -o libhello...
分类:编程语言   时间:2014-05-30 02:08:52    阅读次数:467
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!