Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

An example Analysis of the size of classes in C++

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Most people do not understand the knowledge points of this article "case Analysis of the size of classes in C++", so the editor summarizes the following contents, with detailed contents and clear steps, which can be used for reference. I hope you can get something after reading this article. Let's take a look at this "case Analysis of the size of classes in C++" article.

1. The size of the ordinary class # includeusing namespace std;class MyClass {public: MyClass () {int I = 0; float f = 0.01f;}; int getI () {return I;} int getF () {return f;} private: int i; float f / / static variables are actually their global variables, which are stored in the global / static storage area and do not occupy the object space static int staNum;}; int MyClass::staNum = 2int main () {MyClass myclass; cout

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report