How to use static function in class with C++

1 Answer

0 votes
#include <iostream>

class Example {
    public:
        static void print() {
            std::cout << "static void print()";
        }
};

int main() {
    Example::print();
}  
  
  
  
/*
run:
  
static void print()
  
*/

 



answered Nov 27, 2022 by avibootz

Related questions

1 answer 198 views
2 answers 166 views
1 answer 185 views
1 answer 201 views
1 answer 138 views
...