短路运算|字符串操作函数|内存mem操作函数

时间:2022-11-02 14:16:51

body, table{font-family: 微软雅黑; font-size: 10pt}
table{border-collapse: collapse; border: solid gray; border-width: 2px 0 2px 0;}
th{border: 1px solid gray; padding: 4px; background-color: #DDD;}
td{border: 1px solid gray; padding: 4px;}
tr:nth-child(2n){background-color: #f8f8f8;}

2016—4—25

#include"string.h"
strlwr()把字符串中大写换成小写
strupr()把字符串中小写换成大写
#include"stdio.h"
#include"string.h"
#include"stdlib.h"
int main()
{
        char a1[]="Hello World";
        char a2[]="yun nan";
        char *b1=strlwr(a1);
        char *b2=strupr(a2);
        printf("%s\n",b1);
        printf("%s\n",b2);
        system("pause");
}
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPwAAABoCAIAAABaPgplAAAAA3NCSVQICAjb4U/gAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAL1klEQVR4nO2d0W8bSR3Hf/Y5TXOH2oYWqQ0V2HcmxOdDIIQQEoKri/zgvFmJThTxQCMUIUftC/VD/AdESL6Xa0keIsWVOO7KoQjzgJI7RYpzHCfxXORbKQS8wBXaqy6Jk7Ru4ibLw3rXs7Mz47Hj2JvM7/Nkz/525rez35357nht+y5fvmwYRuz1H7z9zj1AEAXwG4bR7RwQpKP4AQB1jyiFv9sJIEinQdEjyoGiR5QDb2QR5cCRHlGOAMit3tz/W3FjY0OmxnPnzn3jtVf9frycEI8SkIxb+0fpq6GXAdyXh8/nAwB48PBzMAwA+O+jv1/+8qXz58+3MUsEaSOyou//Yv9rkbBgSnj162EA8Pngo4//uru725bkkCNAz40m1ia0qVi3E+kesiYk4Pfp//rsrXc+vn3vL3fe++jX83+eyX9Y+ueDypPtx48ePn708OmT7bc/uP+b9+8LqylkIhaZgrN8NKfLxx8eZot2c8QmPTfqTqGeFzOSKGRGMhuyyum06jVkCoy0ifyOoJtYiE4Wc4PXkBW9YRg+3wt6eUff3vl3Zes/u+VPq5vV6j4YB2TYC6cOeDVAIROJpGBGqxFfIjooNp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z5J4cmDG8eYOXEu9wxLcBDbOlsjrSeMSk/u+Cv333d9S2hp6YKmTOtpKGRIw3Rymeu/DmYO/NPuwKItEjJwkUvY2/2wkgSKfxxC+cIR1AwRGdB470iHKg6BHlQNEjyoGiR5QDRY8oB4oeUQ4UPaIcKHpEOVD0iHKg6BHl8N+5c6fbOSBIR/HfuHGj2zkgSEdBe4MoB4oeUQ4UPaIcKHpEOVD0iHL8Hx6IxcDIkO/oAAAAAElFTkSuQmCC" />
2016—4—26
\r   换行,会到本行开头(Home)
\b   退格,光标后退一格
C语言只有字符串变量,没有常量
2016—4—27
float 有效位6-7位
double  15-16
long double  18-19
long long  8个字节
vs (ctrl+k,ctrl+f)可以自动控制代码格式对齐
~按位取反
^按位异或    1010       &按位与    1010
                      0111                        0111
             ------------                 ------------
                      1101                        0010
计算机中数都是按补码存放的,正数的二进制就是原码,反码和补码全都相同;负数的原码是二进制表示,反码为原码最高位不变其余各位取反、补码为反码+1;
#include <iostream>
using namespace std;
int main()
{
   int a=4,b=3;
   cout<<"~a="<<~a<<"   ~b"<<~b<<endl;
   cout<<"a^b="<<(a^b)<<endl;
   cout<<"a&b="<<(a&b)<<endl;
   system("pause");
  return 0;
}
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOkAAACICAIAAACN/VtLAAAAA3NCSVQICAjb4U/gAAAACXBIWXMAAA7EAAAOxAGVKw4bAAALLUlEQVR4nO2dTW/byBnHH2nlON4tkrhJgRQtWinrutZqixZFURQoUEQBfJBvgvUJfMhBvkYH6wP4or30xT4EsA4tiqKAUfVQ2FsYMLXdLtBzCpWA61Zsu2mTXazfE8VWbPZAiRwOh0NSpl7o/H8neTia5+HMn888HHLkmK7rBEAEiQ/bAQB6BNoFUQXaBVEF2gVRBdoFUSUhOfbkr439/X0/rdy6des7778Xj+NKAINDpt3dfzS/mbpH5FxEi8ViRERPn31Buk5E/33+969/7au3b9/uk5cAOJFpd/LLk++npyTrv+99e4qIYjH6+JO/nJ6ehu4cC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ueut5f7Vv8J0tCu/qfLTkHAgQ8fMNYXx1emD27n4dFJSX351jQhuYzea3galo13/iay8UD6QXFdy90BujfvpaGeoFtZxi+JuLrmdjjxF9vSW86qv9a8w/HM1z3yRKxROYT5neTmjGTPcpuzRDL2j2Ydh4fpMGFwBrrZ248N2AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAYEv8HQ62aZECXVu8AAAAASUVORK5CYII=" />
4-------0000 0100  
~-------1111 1011  负数,计算机中存的是补码
反码---- 1000 0100
补码-----1000 0101    -5

 -------------------------------------------------------------------
计算机中都是按补码运算的,int a = -11 ;  ~a = 10 ;
1、a 在计算机中是按补码存放的---> 1000 1011 ==》1111 0101
2、进行取反操作--->  1111 0101 ==》0000 1010  就是十进制的 10
短路运算|
短路运算符就是我们常用的“&&”、“||”,一般称为“条件操作”。
If(a>b||printf(“a小于b”))
如果a>b就运行下面,否则输出printf;
#include"stdio.h"
#include"stdlib.h"
int main()
{
        int a=10,b=3;
        if(a>b||printf("a<b\n"));
        if(a<b||printf("a>b\n"));
        system("pause");
}
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAP0AAABKCAIAAAD/mMVmAAAAA3NCSVQICAjb4U/gAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAKb0lEQVR4nO2dzW8jSRnGX3uTSWYXzUx2BmkQCOxZE+L1IhBCCAkJpQdFyLlZ8QEhTj7k4FzjQ/wH+OK9sJAcRkofWIZdNNZ4NYJ4V5HSWZaVOA8yLYWAG9iBmR1tEudjktiTNId2t6urq8plj+3Y0+/v5FS/XfV21VPVT5c/Enjwx49qtdoH9+6+e/c9QBB/EDTPTTDNi04DQfpK0AQTZY/4jaB5bprm+UWngSB9JWiCeY4LPuIzRkxTyt8//Gt5d3dXpsZr1659+603g8HgC+eGIL1ixDSl/P32PyrfCN8C8IYGAgEAgEePv7Dmz3+f/P1rX/3K9evXu50qgnSN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ozH+QAAAABJRU5ErkJggg==" />
2016—4—28
#include"stdio.h"
#include"stdlib.h"
#include"setjmp.h"
jmp_buf envbuf;  //定义变量
int ret;
void sum()
{
        printf("ret is %d\n",ret);
        printf("I am sum\n");
        longjmp(envbuf,1);
        printf("I am not here\n");
}
int main()
{
        ret=setjmp(envbuf); 
//跳转函数,ret=0;跳转后longjmp的第二个参数就为setjmp的返回值
        if(0==ret)
        {  sum();  }
        printf("ret is %d\n",ret);
        system("pause");
}

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOYAAABpCAIAAACh7sjhAAAAA3NCSVQICAjb4U/gAAAACXBIWXMAAA7EAAAOxAGVKw4bAAALjklEQVR4nO2d328bWRXHj71J0+6itqFFKgKB3fWGeL0IhBBCQkJxUYScNyt+QIinCEXIea0f4j/AL94XfiQPlTJCLEub1upU6pIURYq9LCvxXGRGCgEPsGXbrTaJk7Rp4ibDw3jGd+7cez3jn7n1+TzZd86ce+ber88988N24N79B4Wbv33v/ZuAIDIQNAyj3zEgiA9QsohkBA3jpN8xIIgPhrxk2Yd/K29vb3txd/HixW++83YwGGw7MARh40mym/+sfD18FcBtGQgEAAAePf4cDAMA/vfkH1/9ypcvXbrU8UARxGTIYAiRZvSLo+9EIwJtv/2NCAAEAvDRx389PDzsYHxIR9GVVGJzTsvF+x1IGwS9lLJDwYD+789++f7Hv7r5l18vf/Sbwp8X1Q8r/3p08Gzv6ZPHT588fv5s770/Pfzdg4dCN8Vs1CJbdLanFN27ffswe7S7IzbpSsodQiMupiXRyLRkdmS102E1PGSLjLCJ+LowTCxEk8Xc0HGCrOWexjCMQOA1vbqv7+3/52D3v4fVT2o7tdoxOPX+2hm+/IvZaDQNi1qdyTXi8OKzGVhZ1z3bm+hKyu8U2bu4e9SVVHojs6ppmrY4lk+YjovZRH7MjGExqaatxoXIqhkV23Isf92MlWnJ7MhU3hokXYNme9ByceZAASTtUVqEdNdlyxw6VvBdw9N50uFRDQC+dHkkcKZWre0+ffH544PPAAA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TkSuQmCC" />

2016—4—29
char *strncpy( char *to, const char *from, size_t count );
//将字符串from 中至多count个字符复制到字符串to中。如果字符串from 的长度小于count,其余部分用'\0'填补。返回处理完成的字符串。会覆盖
char *strncat( char *to, const char *from, size_t count );
//将字符串from
中至多count个字符连接到字符串to中,追加空值结束符。返回处理完成的字符串。
int strncmp( const char *str1, const char *str2, size_t count );
//比较字符串str1str2中至多count个字符。str1比str2少,返回小于0的数;str1等于str2,返回0;str1大于str2,返回大于0的数 。
eg:strncpy(str1,str2,count)    strncat(str1,str2,count)    strncmp(str1,str2,count)

void *memset( void *buffer, int ch, size_t count );
//函数拷贝chbuffer 从头开始的count 个字符里, 并返回buffer指针。
memset() 可以应用在将一段内存初始化为某个值。
memset(str(int),'\0'(0),sizeof(int))   //字符串(整形)数组置0,不要置成其他字符

void *memcpy( void *to, const void *from, size_t count );
//函数从from中复制count 个字符到to中,并返回to指针。
如果tofrom 重叠,则函数行为不确定,复制从第一个开始,会产生覆盖。
eg:  memcpy(str1(int),str2(int),size)         int a[10],int b[10]={1,2,……},memcpy(a,b,sizeof(b))   ->   a[10]={1,2,……};结构体拷贝

int memcmp( const void *buffer1, const void *buffer2, size_t count );
//函数比较buffer1buffer2的前count 个字符
eg:memcmp(int,int,size)(这个只能比较内存(整形、浮点型之类)的)

void *memmove( void *to, const void *from, size_t count );
//与mencpy相同,不同的是当tofrom 重叠,函数正常仍能工作。
eg:memmove(str1,str2,size)  自己往自己身上拷贝  abcde->deabc
全局变量   int a;  外部文件引用extern int a;      //比如我的.c文件里有定义全局变量,头文件里要用,可以直接extern引入。
全局变量   int a;  想要只能自己文件引用  其他文件不能引用,static int a;
定义好一个局部变量的字符数组最好要把它初始化为空--》char sstr[10]="";  或者char sstr[10]={};
main函数中的 argv[0] 表示的是 .exe 文件

短路运算|字符串操作函数|内存mem操作函数的更多相关文章

  1. C 语言函数手册:涵盖字符测试、字符串操作、内存管理、时间换算、数学计算、文件操作、进程管理、文件权限控制、信号处理、接口处理、环境变量、终端控制

    1. 字符测试函数 函数 说明 isascii() 判断字符是否为ASCII码字符 2. 字符串操作 函数 说明 gcvt() 将浮点型数转换为字符串(四舍五入) index() 查找字符串并返回首次 ...

  2. 机器学习入门-文本数据-构造词频词袋模型 1&period;re&period;sub&lpar;进行字符串的替换&rpar; 2&period;nltk&period;corpus&period;stopwords&period;words&lpar;获得停用词表&rpar; 3&period;nltk&period;WordPunctTokenizer&lpar;对字符串进行分词操作&rpar; 4&period;np&period;vectorize&lpar;对函数进行向量化&rpar; 5&period; CountVectorizer&lpar;构建词频的词袋模型&rpar;

    函数说明: 1. re.sub(r'[^a-zA-Z0-9\s]', repl='', sting=string)  用于进行字符串的替换,这里我们用来去除标点符号 参数说明:r'[^a-zA-Z0- ...

  3. 利用切片操作,实现一个trim&lpar;&rpar;函数,去除字符串首尾的空格,注意不要调用str的strip&lpar;&rpar;方法

    1.利用切片操作,实现一个trim()函数,去除字符串首尾的空格,注意不要调用str的strip()方法 首先判断字符串的长度是否为0,如果是,直接返回字符串 第二,循环判断字符串的首部是否有空格,如 ...

  4. python练习题:利用切片操作,实现一个trim&lpar;&rpar;函数,去除字符串首尾的空格,注意不要调用str的strip&lpar;&rpar;方法

    方法一: # -*- coding: utf-8 -*- # 利用切片操作,实现一个trim()函数,去除字符串首尾的空格,注意不要调用str的strip()方法: def trim(s): whil ...

  5. day3-Python集合、函数、文件操作,python包的概念

    本节大纲: 1 python程序由包(package).模块(module)和函数组成.包是由一系列模块组成的集合.模块是处理某一类问题的函数和类的集合. 2 包就是一个完成特定任务的工具箱. 3 包 ...

  6. Python自动化开发&lpar;三&rpar;&colon;循环次数控制、常用数据类型、字符串格式化、列表常用操作、列表的后续操作

    计数器的作用可以在死循环中,符合条件的情况下做自动退出中断 #!/usr/bin/env python # _*_ coding: utf-8 _*_ # @Time : 2017/3/14 11:2 ...

  7. Python学习日记(六)——内置函数和文件操作(lambda)

    lambda表达式 学习条件运算时,对于简单的 if else 语句,可以使用三元运算来表示,即: # 普通条件语句 if 1 == 1: name = 'prime' else: name = 'c ...

  8. python 集合、函数和文件操作

    1.set集合 set集合是一个无序.不可重复.可嵌套的序列,基本功能是进行成员关系测试和删除重复元素,可以使用大括号({})或者 set()函数创建集合,注意:创建一个空集合必须用 set() 而不 ...

  9. Python基础&lpar;三&rpar;——集合、有序 无序列表、函数、文件操作

    1.Set集合 class set(object): """ set() -> new empty set object set(iterable) -> n ...

随机推荐

  1. 用SVN check out项目后第三方库丢失

    曾经用Cornerstone check out 一份项目下来,但其中第三方.a库始终丢失,项目报错,研究后找到了以下解决方法: 首先,Xcode默认忽略.a 文件.所以无法提交到svn服务器,但是很 ...

  2. Ubuntu搭建Ruby On Rail环境

    受不了Ruby在Windows上的执行等待,转战至ubuntu linux下使用,为方便不同版本ruby的使用,采用了rvm安装Ruby on rails环境. 安装rvm //获取认证 gpg -- ...

  3. 服务器响应HTTP的类型ContentType大全

    ".*"="application/octet-stream" ".001"="application/x-001" & ...

  4. JVM学习总结五&lpar;番外&rpar;——JConsole

    之前本来打算结合自己写的小程序来介绍JConsole和VirtualVM的使用的,但是发现很难通过一个程序把所有的场景都体现出来,所以还是决定用书中的典型小例子来讲更加清晰. 一.JConsole的基 ...

  5. Ceph部署(二)RGW搭建

    背景 Ceph RGW简介 Ceph RGW基于librados,是为应用提供RESTful类型的对象存储接口.RGW提供两种类型的接口: 1) S3:兼容Amazon S3RESTful API: ...

  6. Python用Pillow&lpar;PIL&rpar;进行简单的图像操作

    Python用Pillow(PIL)进行简单的图像操作 颜色与RGBA值 计算机通常将图像表示为RGB值,或者再加上alpha值(通透度,透明度),称为RGBA值.在Pillow中,RGBA的值表示为 ...

  7. java消息服务学习之JMS高级特性

    将介绍的内容是: 控制消息确认.为发送消息指定选项.创建临时目的地.使用JMS本地事务.异步发送消息 五个方面. 1.控制消息确认 在JMS消息得到确认之前,并不认为它已经成功使用.要成功使用消息,通 ...

  8. Spring Boot 揭秘与实战 自己实现一个简单的自动配置模块

    文章目录 1. 实战的开端 – Maven搭建 2. 参数的配置 - 属性参数类 3. 真的很简单 - 简单的服务类 4. 自动配置的核心 - 自动配置类 5. spring.factories 不要 ...

  9. MapReduce源码刨析

    MapReduce编程刨析: Map map函数是对一些独立元素组成的概念列表(如单词计数中每行数据形成的列表)的每一个元素进行指定的操作(如把每行数据拆分成不同单词,并把每个单词计数为1),用户可以 ...

  10. Murano Weekly Meeting 2016&period;06&period;28

    Meeting time: 2016.June.28 1:00~2:00 Chairperson:  Kirill Zaitsev, from Mirantis Meeting summary: 1. ...