What is the difference between a static and a dynamic memory cell in the C language?

Updated on science 2024-03-25
10 answers
  1. Anonymous users2024-02-07

    char sz[5];That is, the static char *psz = new char[5] is the dynamic static 5 must be tested constants can not make variables, and the dynamic can be casual, can be expressions or constants or variables, because the static ones are allocated after compilation, and the dynamic ones are determined in the process of running; For example, I write char sz[5] in the program; Then you can't change this memory during the run, the allocation size is always the same from the beginning to the end of the run, and if I write int i in the program; cin >>i;char *psz = new char[i];The program doesn't assign a size at the beginning, because the value is unknown, and he doesn't know how big the allocation is until I enter the value, and you can't write int i like that; cin >>i;char sz[i];This is a mistake to write, and he will warn that the numbers in parentheses are not constants, and that temporarily allocated memory like this must be freed (delete in C++ and free() in C).

  2. Anonymous users2024-02-06

    Static memory uses stack space memory and does not need to be allocated by itself. Dynamic memory, on the other hand, is allocated and reclaimed by the programmer as needed.

  3. Anonymous users2024-02-05

    It's clear here, I don't like to copy someone else's, you can see for yourself.

  4. Anonymous users2024-02-04

    Static memory refers to memory that relies on two steady states of a bistable trigger to hold information. Bistable circuits are active devices that require power to work, and as long as the power supply is normal, they can store information stably for a long time, so they are called static memory. If the power is lost, information is lost, which is volatile memory, or volatile.

    Dynamic memory refers to memory that is shared between specified functions or applications. If one or two applications occupy all the memory space, you will not be able to allocate memory space for the other applications. The memory control circuit needs to refresh the memory at a certain period to maintain data storage.

  5. Anonymous users2024-02-03

    SRAM, there is no need to refresh the circuit, as long as the power is not interrupted, the information is always stored in the memory;

    DRAM DRAM, it is necessary to refresh the circuit, it needs to be refreshed every once in a while, if there is no operation, the information will be lost, our commonly used DDR, DDR2 These belong to the DRAM class.

  6. Anonymous users2024-02-02

    The static is composed of a trigger, which can save data even after power failure, and the dynamic information is saved by the gate capacitance of the MOS tube, which is constantly refreshed and charged.

  7. Anonymous users2024-02-01

    char

    sz[5];It's static.

    charpsz

    newchar[5] is dynamic.

    Static 5 must try constants that can't make variables, while dynamic ones can be casual, expressions, constants, or variables.

    Because the static ones are allocated after compilation, while the dynamic ones are determined during the runtime;

    For example, I write char in my program

    sz[5];Then the memory cannot be changed during the run, and the allocation size remains the same from the beginning to the end of the run.

    And if I write in the program.

    inti;cin>>

    i;char

    psznew

    char[i];

    The program doesn't allocate a size at the beginning, because the value is unknown, and when I enter the value, he doesn't know how big it is, and you can't write that.

    inti;cin>>

    i;char

    sz[i];

    It would be wrong to write this way, and he would warn that the numbers in parentheses are not constants.

    Temporarily allocated memory like this must be freed (delete in C++ and free() in C).

  8. Anonymous users2024-01-31

    I've just figured it out, so don't be surprised if you can't say it well.

    1,inti=3;

    This one is static.

    2,inti=new

    int;This is dynamic.

    The first sentence of the program allocates memory at compile time.

    Of course, it also depends on whether the definition is inside or outside the function.

    In the function, it is automatically stored, that is, it is automatically generated when the function is called, and the automatic storage space is used when the function dies at the end.

    Outside of the function (and with the static keyword) it is static storage, i.e. it is automatically generated when the program is called, and dies when the program ends.

    Use static storage space.

    The second sentence is dynamic storage.

    The program does not allocate memory space when it is compiled and run, and only when the statement is run.

    So it is usually preceded by conditional judgment or requires the user to input specific data, such as a dynamic array, you may not be sure how big it is when programming, and when the user enters a definite value, you know how much dynamic storage should be defined, reflecting the flexibility of the pointer to c.

    c++primer

    Here's how it looks.

    Variables are compiling.

    When you have to allocate memory, just like when you go on vacation, when you don't go, you have to go every day** arranged the pointer but can do it in the running is to allocate memory, you can go where you want to go when you are on vacation?

  9. Anonymous users2024-01-30

    c The class in which the language variables are stored.

    The storage space in memory for users is divided into two parts: the ** area and the data area. Variables are stored in the data area, which can be divided into static storage area and dynamic storage area.

    Static storage refers to the way in which a null glare allocates a fixed amount of storage space to a variable while the program is running. For example, global variables are stored in.

    In the static storage area, a null judgment room is allocated when the program is running, and the program is released after it is run.

    Dynamic storage refers to the way in which storage space is dynamically allocated according to actual needs while a program is running. Such as the form parameter is saved.

    The excavation is in the dynamic storage area, and the space is allocated when the function is called, and the call is released after the call.

  10. Anonymous users2024-01-29

    On August 18, 2008, IBM, AMD and the School of Nanoscience and Engineering (CNSE) of the State University of New York at Albany jointly announced the successful development of the world's first 22nm node active static random access memory (SRAM). This is also the first time in the world that an effective storage cell has been announced in a 300 mm research facility environment. SRAM chips are the "precursors" of more complex devices, such as microprocessors.

    The size of the SRAM unit is a key technical indicator in the semiconductor industry. The latest SRAM units utilize a traditional six-transistor design that occupies only a micron in square meters, breaking the previous SRAM scale reduction barrier.

    The new research work is being done at the School of Nanoscience and Engineering (CNSE) at the State University of New York at Albany, where many of the top semiconductor research by IBM and other partners is conducted. Dr. IBM Technologies, vice president of R&D, said, "We are conducting research at the ultimate edge of possibility, moving towards advanced next-generation semiconductor technology. The new research results are essential to drive the pursuit of miniaturization of microelectronic devices.

    22 nm is the next two generations of chip manufacturing, while the next generation is 32 nm. In this regard, IBM and its partners are developing their unrivaled 32nm High-K Metal Gate Technology.

    Traditionally, SRAM chips have been made more tightly together by shrinking the basic building blocks. IBM Alliance researchers have optimized the design and circuit diagram of the SRAM unit to improve stability, and they have developed several new manufacturing processes to make the new SRAM unit. The researchers used high-naimmersion lithography to engrave the pattern dimensions and densities, and fabricated the parts in an advanced 300-millimeter semiconductor research environment.

    Key technologies related to SRAM cells include sideband high-K metal gates, <25nm gate-length transistors, ultra-thin isolation structures (spacers), co-doping, advanced activation technologies, ultra-thin silicide films, and embedded copper contacts.

    It is reported that at the IEEE International Electronic Equipment (IEDM) annual meeting to be held in San Francisco, USA from December 15 to 17, 2008, there will be a special report to introduce the details of the latest results.

Related questions
12 answers2024-03-25

This is an additive function I wrote that can judge overflow: >>>More

8 answers2024-03-25

It is the return value of the subfunction, and the main function also has a return value, but it is generally not used and ignored. >>>More

12 answers2024-03-25

This problem requires understanding that the system allocates memory to static variables when compiling, and the memory units occupied by them are not released after the function call ends, that is, the value of the variable is the value of the previous function call at the next function call. >>>More

11 answers2024-03-25

Valid variable names for the C language:

First, it can only contain numbers, letters, and underscores. >>>More

10 answers2024-03-25

In the C language, files can be divided into ASCI files and binary files according to the way the data is organized. ASC code. >>>More