struct books { char name[100]; float price; int pages; };
Declaring a structure Without creating objectin structure, does the structure take up space in memory for its own DATA MEMBERS?
object
structure
DATA MEMBERS
A structure definition is usually not part of the binary in C. It exists only in your source code.
( , , ..), , , ( ).
, , , .
, , .
?
- , , . , .
:
const struct books myBooks = { ...initialization code... }; \\ Consuming CODE memory (typically ROM)
struct books myBooks = { ...initialization code... }; \\ Consuming DATA memory (typically RAM)
No. In a compiled type of program, declarations / definitions exist only as concepts of compilation time. They do not leave traces in the compiled code and do not affect memory consumption at runtime. Storage in program C is occupied by objects. Types are not objects.
Source: https://habr.com/ru/post/1525466/More articles:Why is StaticFileHandler not a .json server? - jsonIOS Error "Initialization" NSTimeInterval * '(aka' double * ') - iosUsing const in header file - c ++https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1525464/how-to-run-appcmd-in-powershell-to-add-custom-headers-to-the-default-web-site&usg=ALkJrhi-SClTarYeHOJskeLndl8ApO4F2Apandoc Enable file filter in haskell - haskellAFNetworking 2.0 SOAP web service: how to make a request? - soapМаршрутизация атрибутов для нескольких параметров DateTime - asp.net-mvcИспользуйте роль рабочего агента Windows Azure с сельдереем - pythonUsing jQuery to switch div visibility - javascriptHow do you set a value in a ConcurrentDictionary regardless of whether it contains a key - c #All Articles