09 2013 档案
'extern'
摘要:The external variables in methods are defined by the first lines of the example above, whichstate their type and cause storage to be allocated for them. Syntactically, external definitions are just likedefinitions of local variables, but since they occur outside of functions, the variables are exter
阅读全文
"%s"
摘要:The %s format specification in printf expects the corresponding argument to be a string represented in thisform.
阅读全文
'\0'
摘要:the character '\0' (the null character, whose value is zero) at the end of the array it is creating, tomark the end of the string of characters. This conversion is also used by the C language: when a string constantlike"hello\n"appears in a C program, it is stored as an array of ch
阅读全文
LINUX 下 一些常用的信息显示命令:
摘要:tcsh——shell程序,它可以在登录shell和shell 脚本命令处理器之间做命令语言解释器。stat——显示指定文件的相关信息who、w——显示在线登陆用户whoami——显示用户自己的身份hostname——显示主机名称uname——显示操作系统信息free——显示当前内存与交换空间的使用情况ifconfig——显示网络接口信息ping——测试网络连通性netstat——显示网络状态信息route——显示路由相关信息
阅读全文
return zero,or ,return non-zero
摘要:it may return a value to its caller, which is in effect the environment in which the program was executed.Typically, a return value of zero implies normal termination; non-zero values signal unusual or erroneoustermination conditions.as a reminder that programs should return status totheir environme
阅读全文
int c, int ndigit[10]; ++ndigit[c-'0'];
摘要:for example c-'0' is an integer expression with a value between 0and 9 corresponding to the character '0' to '9' stored in c, and thus a valid subscript for the array ndigit
阅读全文
Write a program that prints its input one word per line.
摘要:#include #define State '\n' void main(){ int Juge=0;/*only one space*/ int c=0; while((c=getchar())!=EOF) { if(c==' '||c=='\t'||c=='\b') { if(Juge==1) { putchar(State); Juge=0; } } else ...
阅读全文
Write a program to copy its input to its output, replacing each tab by \t, each backspace by \b, and each backslash by \\. This makes tabs and backspa
摘要:#include #define DBS '\\'void main(){ int c; while((c=getchar())!=EOF) { if(c=='\t') { putchar(DBS); putchar('t'); } else if(c==' ') { putchar(DBS); putchar('b'); } else if(c=='\\') { ...
阅读全文
Write a program to copy its input to its output, replacing each string of one or more blanks by a single blank.
摘要:#include void main(){ int c,c_BCN; while((c=getchar())!=EOF) { if(c!=' ') c_BCN=0; if(c==' ') ++c_BCN; if(c_BCN<=1) putchar(c); } printf("\n%d\n",c);}df ff f f fff d fg fggdf ff f f fff d fg fgg
阅读全文
C program Language 'EOF' and 'getchar()'
摘要:#include void main(){ int c; c=getchar(); while(c!=EOF) { putchar(c); c=getchar(); }}getchar() returns a distinctive value when there is no more input, a value that cannot be confused with any real character. This value is calledEOF, for ``end of file''.Q: The ty...
阅读全文
linux下 解释 终端命令 ls -al或者ls -li 输出的信息
摘要: ls -liinode值 文件类型权限 连接计数 文件拥有者 文件群组 大小 修改日期 名称12976146 drwxr-xr-x. 2 wjshan0808 wjshan0808 4096 Sep 16 12:37 Desktop注:连接计数 - 2 = 本目录直接包含的子目录和文件的总和
阅读全文
Linux 文件类型 ,文件权限
摘要:第一个字符段:文件类型。第二个组字符段又分为三段(每三个字符为一段不足用‘-’):文件属性。1. drwxrwxrwx 2. -rwxr-xr-x第一字符段: 第二字符组段依次为:- :普通文件 1.文件拥有者 2.文件所属的组群成员 3.其他用户d :目录 r:可读 w:可写 x:可执行l :链接b:块设备文件c:字符设备文件、p:管道文件s:套接文件
阅读全文
CentOS 的数字命令级别
摘要:1 user commands2 system calls3 library functions4 special files5 file formats6 games7 conventions and miscellany8 administration and privileged commands这些只能有root执行
阅读全文
'printf' Function
摘要:printf is not part of the C language; there is no input or output defined in C itself.printf is just a useful function from the standard library of functions that are normally accessible to C programs.The behaviour of printf is defined in the ANSI standard,(美国国家标准协会 American National Standards Insti
阅读全文
'%' For instance '%d'
摘要:with each % indicating where one of the other (second, third, ...) arguments is to be substituted, and in what form itis to be printed. For instance, %d specifies an integer argumentaugment each %dFor Instanceprintf("%3d'F%6d'C\n",Fahrenheit,Celsius);to print the first number of ea
阅读全文
"Celsius=5/9*(Fahrenheit-32)" and "Celsius=5*(Fahrenheit-32)/9 "
摘要:The reason for multiplying by 5 and dividing by 9 instead of just multiplying by 5/9 is that in C, as in many otherlanguages, integer division truncates: any fractional part is discarded. Since 5 and 9 are integers. 5/9 would betruncated to zero and so all the Celsius temperatures would be reported
阅读全文
Data types 'int' and 'float'
摘要:The type int means that the variables listed are integers; by contrast with float, which means floating point,i.e., numbers that may have a fractional part. The range of both int and float depends on the machine you areusing; 16-bits ints, which lie between -32768 and +32767, are common, as are 32-b
阅读全文
escape sequence "\c"
摘要:#include int main(){ printf("Hello World !\c"); return 0;}[10:40:36@wjshan0808 ~/Documents/C Program] g++ printf.cprintf.c: In function ‘int main()’:printf.c:4: warning: unk
阅读全文
#include <stdio.h>
摘要:The first line of the C program#include tells the compiler to include information about the standard input/output library.
阅读全文
控制shell终端提示符格式和颜色
摘要:字体颜色值(ASCII)背景颜色值(ASCII)显示颜色3040黑色3141红色3242绿色3343黄色3444蓝色3545紫红色3646青蓝色3747白色符 号值特效取反0OFF1HighLight2半亮224UndeLine245Blink257反白278不可见注:若着色不对,哈哈,请认为我是色...
阅读全文
解决Centos 6.4 下安装WPS 出现 新建/打开文件闪退的问题
摘要:# wget http://archives.fedoraproject.org/pub/archive/fedora/linux/updates/17/i386/freetype-2.4.8-4.fc17.i686.rpm# rpm2cpio freetype-2.4.8-4.fc17.i686.rpm |cpio -idmv# 解压后与安装包同目录下生成usr文件夹。。。# cp usr/lib/libfreetype.so.6.8.0 /opt/kingsoft/wps-office/office6# ln -s libfreetype.so.6.8.0 libfreetype.so..
阅读全文
CentOS 关闭暂不需要的系统服务
摘要:需要保留的服务:crond、iptables、irqbalance、microcode_ctl、network、random、sshd、syslog、local一 。使用命令:ntsysv 打开选项窗口进行操作 Press to choice二 、脚本完成:for i in `ls /etc/rc3.d/S*`do CURSRV=`echo CURSRVcase $CURSRV in crond | iptables | irqbalance | microcode_ctl | network | random | sshd | sysl...
阅读全文
centos6.4 卸载 vim7.2 安装vim7.4
摘要:一、# rpm -qa|grep vimvim-minimal-7.2.411-1.8.el6.x86_64vim-enhanced-7.2.411-1.8.el6.x86_64vim-common-7.2.411-1.8.el6.x86_64# rpm -e vim-minimal-7.2.411-1.8.el6.x86_64 vim-enhanced-7.2.411-1.8.el6.x86_64 vim-common-7.2.411-1.8.el6.x86_64 --nodeps二、# wget ftp://ftp.vim.org/pub/vim/unix/vim-7.4.tar.bz2。
阅读全文
Centos 6.4 安装KSnapshot 和gimp截图工具
摘要:一、# wget http://www.ibiblio.org/pub/Linux/X11/xutils/ksnapshot-0.2.7.tar.gz# tar -zxvf ksnapshot-0.2.7.tar.gz# cd ksnapshot# lsacconfig.h config.h.in COPYING ltconfig READMEacinclude.m4 config.log CVS ltmain.sh searchappsacinclude.m4.in config.status ...
阅读全文
Centos 6.4 安装Mplayer 播放器
摘要:1.Download the rpmforge-release package.URL1:x86_64.rmp URL2:tar.gz 推荐!!!2.Install DAG's GPG key# rpm --import http://apt.sw.be/RPM-GPG-KEY.dag.txt3.(可以取消)Verify the package you have downloaded# rpm -K rpmforge-release-0.5.2-2.el6.rf.x86_64.rpmrpmforge-release-0.5.2-2.el6.rf.x86_64.rpm: (sha1) d
阅读全文
Centos 6.4 安装/卸载 Adobe Reader 9(.bin .tar.bz2 rpm 包)
摘要:一、To install Adobe Reader 9.1 using a tarball installer1. Open a terminal window.2. Change directory (using the cd command) to the directory that contains the tarball archive.3.Run following command# bunzip2 AdbeRdr9.1.0-1_i486linux_enu.tar.bz2# tar -xvf AdbeRdr9.1.0-1_i486linux_enu.tar4.In the new.
阅读全文