zoukankan      html  css  js  c++  java
  • C语言学习

    1.查找字符串用的函数

    # include《string》     
              char *strstr(const char *haystack, const char *needle)
    

    作用:查找一组字符串中的某个单词
    例——》在 字符串 table[]={my name is startport} 查找 “name”
    用法
    ( 首先明确一点,返回值问题。
    若找到单词,返回当前第一个字母的地址。没有则返回NULL)

           if(strstr(table, "name") )     //查找有没有这个单词
           {  
                  找到;
            }
            
            whlie(!strstr(table, "name") ); 这个是等待接收到数据,再运行
    

    2,memset(g_ucPswBuffer,0xff,PW_EEPROM_LENTH);

      **作用**:用来写入数组值,一般用来 初始化数组
             例——》在  初始化数据 table[10]={} 为oxff
    

    用法

          memset(table,0xff,10);//目标数据地址,要初始化值,数组个数
    
  • 相关阅读:
    boost库:函数对象
    boost库:智能指针
    linux 查看和修改文件时间
    linux正则表达式
    UVA
    UVA
    UVA
    UVA
    UVA
    对JavaScript的认识?
  • 原文地址:https://www.cnblogs.com/asnail/p/10088024.html
Copyright © 2011-2022 走看看