易截截图软件、单文件、免安装、纯绿色、仅160KB

c/c++语言中的字符集和字符编码

 在c语言中,hello world程序的编码其实未必就只有那一种书写格式,有些格式看起来有点乱码,却依然有着能正常编译,运行的良好品性,真是难能可贵,其中的秘密,看一看c语言中字符集和字符编码的描述吧。
??= include<stdio.h>
int main( int argc, char* argv??(??))
<%
      if( argc > 1 )
            printf( "Hello, %s!??/a??/n", argv<:1:>);
      return 0;
%>
c语言中,源字符集和执行字符集都有基本字符集和扩展字符,为了是程序都能顺利编译运行,最好都用基本字符集中的字符。ISO/IEC 646标准允许把本国额外需要的字符安排到原先ASCII中"[", "]", "{", "}" 等占据的位置。为了将这些非标准内容有更好的可读性,c标准委员会有用“三联符序列” 表示缺少的字符。
三联符序列如下:
??= (#)         ??) (])          ??( ([)
??!  (|)           ??/(\)          ??- (~)
??> (})          ??<({)        ??'  (^) 
而在c++中,又引入了替换标记
替换记号:
<%({)            %>(})           <:([)           :>(])            %:(#)            %:%:(##)     
and(&&)         bitor(|)         or(||)           xor(^)         compl(~)        bitand(&)
and_eq(


相关文档:

C_关系和逻辑运算

 源码:
# include <stdio.h>
 
int main()
{
    /* 定义一个整数类型的变量,用来存放后面算式的值 */
    int logic;    
 
    int a = 1;
    int b = 2;
    int c = 3;
 
&n ......

C_在switch

 源码:
# include <stdlib.h>
# include <stdio.h>
 
int main()
{
    int month;
    int day;
     
    printf("please input the month number: ");
    scanf("%d", &mo ......

C_综合使用数组实现简单的学生成绩管理系统

 源码:
/* 学生成绩查询系统 */
# include <stdio.h>
# include <stdlib.h>
 
int main( )
{
    int select;
    int i, j;
    int score[5][7];
    int average = 0;
    int sum = 0;
  &n ......

C_简单的子函数调用

 源码:
# include <stdio.h>
 
/* 子函数声明 */
int square(int x); // 实现求平方值的子函数
int cube(int y);   // 实现求立方值的子函数
 
int main()
{
    int m = 12;
    int n = 4;
    printf("%d %d\n", sq ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号