Equivalent of Java static class in C++???

Hello I am quite fluent in java but am currently having issues switching over to c++.

In Java I could have something like

1
2
3
4
5
6
7
8
class myClass{
   .....

   static class myStaticClass{
      .....   
   }

}


What is the equivalent of that in c++ ?

Can it be done in a similar way? Declaring a static class in .h file, then mentioning it in the .cpp file? Will that work?

Please help, really quite confused with this atm

Cheers
Just leave out the static and make sure the nested class is public. Then you can use it outside the class, since all nested classes are static in the Java sense.
So a nested public class in c++ is Java's answer to a static class?

Ill take your word for it but online I read some horrendous looking examples and but didnt get them either.
Topic archived. No new replies allowed.