nginx operating skills in C language learning

#pragma once
#ifndef CLANGTEST_H__
#define CLANGTEST_H__

#define ngx_debug_init()
#define NGINX_VERSION      "1.17.7"
#define NGINX_VER          "nginx/" NGINX_VERSION




#endif // !CLANGTEST_H__
ClangTest.h
#include <iostream> 
#include " ClangTest.h " 

static  Corinthians ngx_test ();
static  Corinthians hello (); 

typedef Corinthians (* intPtr) (); 

intPtr me [] = {ngx_test}; 

Corinthians (* funArray []) () = {ngx_test, ngx_test, hello, ngx_test, hello, ngx_test, hello, hello, hello, hello, hello, ngx_test, ngx_test, ngx_test, ngx_test};
Corinthians Main ( Corinthians argc, char * argv []) {
     using  namespace std; 
    ngx_debug_init (); 
    cout << " hello world" << std::endl;
    cout << NGINX_VER << endl;
    for (int i = 0; i < sizeof(funArray) / sizeof(int(*)()); i++) {
        cout << funArray[i]() << std::endl;
    }
    system("pause");
    return 0;
}


int ngx_test() {
    using std::cout;
    using std::endl;
    cout << "ngx_test" << endl;
    return 0;
}

static int hello() {
    using std::endl;
    using std::cout;
    cout << "Function test hello" << std::endl;
    return 5;
}

 

Guess you like

Origin www.cnblogs.com/zhangdewang/p/12605198.html
Recommended