#include
#include
int main()
{
while(1)
{
fprintf(stdout,"hello-std-out");
fprintf(stderr,"hello-std-err");
sleep(1);
}
return 0;
}
#include
int main()
{
int a = 1,2;
printf("a : %d\n",a);
return 0;
}
#include
int main()
{
int i=43;
printf("%d\n",printf("%d",printf("%d",i)));
return 0;
}
#include
int main()
{
float a = 12.5;
printf("%d\n", a);
printf("%d\n", (int)a);
printf("%d\n", *(int *)&a);
return 0;
}
//file1.cint arr[80];
//file2.cextern int *arr;
int main()
{
arr[1] = 100;
printf("%d\n", arr[1]);
return 0;
}
#include
int main()
{
int a=1;
switch(a)
{
int b=20;
case 1:
printf("b is %d\n",b);
break;
default:
printf("b is %d\n",b);
break;
}
return 0;
}
#include
int main()
{
char str[80];
printf("Enter the string:");
scanf("%s",str);
printf("You entered:%s\n",str);
return 0;
}
#include
int main()
{
int i;
i = 10;
printf("i : %d\n",i);
printf("sizeof(i++) is: %d\n",sizeof(i++));
printf("i : %d\n",i);
return 0;
}
#include
#include
#define SIZEOF(arr) (sizeof(arr)/sizeof(arr[0]))
#define?PrintInt(expr)?printf("%s:%d\n",#expr,(expr))
int main()
{
/* The powers of 10 */
int pot[] = {
0001,
0010,
0100,
1000
??????};
int i;
for(i=0;i
return 0;
}
#include
#define PrintInt(expr) printf("%s : %dn",#expr,(expr))
int main()
{
int y = 100;
int *p;
p = malloc(sizeof(int));
*p = 10;
y = y/*p; /*dividing y by *p */;
PrintInt(y);
return 0;
}
#include
int main()
{
int i = 6;
if( ((++i < 7) && ( i++/6)) || (++i <= 9));
printf("%d\n",i);
return 0;
}
#includeint main(){int a=3, b = 5;printf(&a["Ya!Hello! how is this? %s\n"], &b["junk/super"]);printf(&a["WHAT%c%c%c %c%c %c !\n"], 1["this"],2["beauty"],0["tool"],0["is"],3["sensitive"],4["CCCCCC"]);return 0;}
#include
int main()
{
char dummy[80];
printf("Enter a string:\n");
scanf("%[^r]",dummy);
printf("%s\n",dummy);
return 0;
}
#include
#define PrintInt(expr) printf("%s : %d\n",#expr,(expr))
int FiveTimes(int a)
{
int t;
t = a<<2 + a;
return t;
}
int main()
{
int a = 1, b = 2,c = 3;
PrintInt(FiveTimes(a));
PrintInt(FiveTimes(b));
PrintInt(FiveTimes(c));
return 0;
}
int FiveTimes(int a)
{
? ? ?int t;
? ? ?t = (a<<2) + a;
? ? ?return t;
}
算法,究竟是個啥?
C語言中的三目運算符是啥?有何用處?
SPI編程時,時鐘相位(CPHA)和時鐘極性(CPOL)怎么理解?
PID算法
都說C語言的精髓是指針,但是指針太難懂了,怎么辦?
C語言經(jīng)典算法十例,附源碼
免責(zé)聲明:本文內(nèi)容由21ic獲得授權(quán)后發(fā)布,版權(quán)歸原作者所有,本平臺僅提供信息存儲服務(wù)。文章僅代表作者個人觀點,不代表本平臺立場,如有問題,請聯(lián)系我們,謝謝!