C语言学习Day7

  • strstr():寻找字符串,找到,返回其内存地址,未找到,返回0(假)
例:
strstr("dysfunctional","fun")
例:
char s0[] = "dysfunctional";
char s1[] = "fun";
if(strstr(s0,s1))
	puts("I found the fun in dysfunctional!");
  • 代码的书写顺序:

    1. 头文件:代码的最前面,以便编译器能够正确的调用函数
    2. 声明全局变量
    3. 其他函数
    4. 主函数
  • 二维数组的写法(数组的数组):strings[…][…]

猜你喜欢

转载自blog.csdn.net/sinat_37012750/article/details/86465399