关于C++自定义命名空间,今天验证了一下命名空间如何使用,和嵌套命名空间以及出现的bug。

  1. 如何自定义命名空间,实例如下:

   insertion_sort.h和insertion_sort.cpp

#pragma once
#ifndef _INSERTION_SORT_
#define _INSERTION_SORT_

namespace insert{
    class insertion_sort
    {
    public:
        static void call();  //定义为类的静态函数,只是为了demo的时候方便调用
    };

    }

#endif
View Code

相关文章:

  • 2021-06-02
  • 2022-12-23
  • 2021-12-17
  • 2022-12-23
  • 2022-12-23
  • 2022-01-23
  • 2022-12-23
  • 2021-06-14
猜你喜欢
  • 2021-12-19
  • 2022-12-23
  • 2021-11-06
  • 2021-04-22
  • 2021-06-26
  • 2022-12-23
相关资源
相似解决方案