• 求string数组完数的个数


    见下面的代码片断,
    
    string str_array[] = {"boog", "gogod", "zero", "loe", "abcdasdfas", 
    "asfdksdljjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
    jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
    jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
    jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
    jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
    jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
    jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
    jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj
    jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj"};
    
    cout << "the max number of the string array is :" 
    << max( str_array, sizeof(str_array)/ sizeof(str_array[0])) 
    << " sizes = " << sizeof(str_array)/ sizeof(str_array[0]) 
    << " sizes of str_array " << sizeof(str_array ) 
    << " sizes of str_array[0] " << sizeof(str_array[0] ) 
    << endl;
    
    
    
    
    
    //output
    
    //the max number of the string array is :zero sizes = 6 sizes of str_array 24 sizes of str_array[0] 4

    一开始怕每个strig的大小不一样,不能求出大小,后来发现其实是可以的.因为里面存的每全个不是真接存大小,

    而是一个指向的指针.

  • 相关阅读:
    计算机操作系统第四、五章自测题-存储管理
    oracle进制转换
    表空间、数据文件增长情况
    游标、type使用示例
    Linux如何查找大文件或目录总结-1127
    Linux如何查找大文件或目录总结
    工具: ass109.awk 分析 Oracle 的跟踪文件
    分页存储过程
    CSDN Oracle版精华帖荟萃
    vi 替换字符串
  • 原文地址:https://www.cnblogs.com/vimmer/p/2819520.html
Copyright © 2020-2023  润新知