Articles in the record category

  1. strlen_analyze

    #include <iostream>
    
    #include <vector>
    
    #include <string>
    
    #include <stack>
    #include <ctime>
    #include <windows.h>
    
    const int n = 1024*1024*500;
    
    using namespace std;
    class timer
    {
        long long t;
    
      public:
        timer()
        {
            t = clock();
        }
        ~timer()
        {
            cout << clock() - t << endl;
        }
    };
    size_t strlen1(const char *str)
    {
        register int length = 0;
    
        while (*str++)
    
            ++length;
    
        return (length …
    Tagged as : program analyze

Pages