数组名的再理解
先看下面的这段代码,程序会输出什么结果?
#include
int main()
{
int a[5] = {1, 2, 3, 4, 5};
int *p = (int *)(&a+1);
printf("%d %d\n", *(a+1), *(p-1));
return 0;
}
答案详见本文的最后。
先来一步步...
分类:
其他好文 时间:
2014-09-04 23:42:40
阅读次数:
191
1 #include 2 3 void main() 4 { 5 int a[10] = {0}; 6 int i,j,t; 7 printf("input 10 numbers:\n"); 8 for (i = 0; i a[i+1]) {16 ...
分类:
其他好文 时间:
2014-09-04 18:32:49
阅读次数:
203
#includeint main() { printf("hello world \n"); return 0;}this is my first C program. And I will use c to realize all Category in this wiki page....
分类:
其他好文 时间:
2014-09-04 16:30:49
阅读次数:
158
printf()函数是格式化输出函数, 一般用于向标准输出设备按规定格式输出信息。
printf()函数的调用格式为: printf("", );
其中格式化字符串包括两部分内容:
一部分是正常字符, 这些字符将按原样输出;
另一部分是格式化规定字符, 以"%"开始, 后跟一个或几个规定字符, 用来确定输出内容格式。
参量表是需要输出的一系列参数, 其...
分类:
其他好文 时间:
2014-09-04 15:00:19
阅读次数:
279
原文链接在GUI程序中使用printf函数: 1 #include 2 #include 3 4 void InitConsole() 5 { 6 int nRet= 0; 7 FILE* fp; 8 AllocConsole(); 9 nRet=_open_o...
分类:
其他好文 时间:
2014-09-04 09:34:47
阅读次数:
182
开发过程经常需要查看某些特定参数。通常的方法可以使用paintf进行打印输出,观察具体的变量值。STM32内部集成有USART的串口功能,可以通过串口直接输出到电脑(上位机)。使用非常方便,基本不需要不需要写代码,只要配置一下就可以使用。简单设置就可以看到上面的效果配置方法: 1、重定向printf...
分类:
其他好文 时间:
2014-09-04 01:22:47
阅读次数:
277
scanf函数称为格式输入函数,即按用户指定的格式从键盘上把数据输入到指定的变量之中。scanf函数的一般形式scanf函数是一个标准库函数,它的函数原型在头文件“stdio.h”中。与printf函数相同,C语言也允许在使用scanf函数之前不必包含stdio.h文件。scanf函数的一般形式为:...
分类:
其他好文 时间:
2014-09-03 21:01:57
阅读次数:
287
1.解压ZIP文件乱码unzip命令加入‘-OCP936’参数即可。unzip-OCP936冰客安全网渗透系列.zip2.禁止Guest账户sudosh-c‘printf"[SeatDefaults]\nallow-guest=false\n">/usr/share/lightdm/lightdm.conf.d/50-no-guest.conf‘此命令创建一个小地配置文件。要重新启用来宾回话,只..
分类:
其他好文 时间:
2014-09-03 13:20:07
阅读次数:
215
一 赋值
int dex = 100;// 默认十进制
int oct = 0144;// 八进制,以0开始
int hex = 0x64;// 十六进制,以0x开始
二 输出
void show(int x)
{
printf("dec = %d; octal = %o; hex = %x\n",x,x,x);
printf("dec = %d; octal = %#o; ...
分类:
编程语言 时间:
2014-09-03 13:04:16
阅读次数:
210