Questions tagged «struct»

5
使用结构和类时有哪些开销和其他注意事项?
嵌入式系统上的C传统上使用结构来保存结构化数据。 Arduino将C ++引入了表格,因此我们可以改用类。 假设我们有两个不同的数据结构,可以认为它们非常相似: typedef struct { int valueOne; int valueTwo; int valueThree; } value_t; 和: class Value { public: int valueOne; int valueTwo; int valueThree; } 在内存方面,这会有什么不同? 我仍然看到大量使用struct技术-为什么这样做?
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.