Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to use sizeof in C language

Shulou Source: shulou.com Published: 2022-05-31 10:56:10 10月20日 Update

Today, the editor will share with you the relevant knowledge points about how to use sizeof in c language. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article. Let's take a look at it.

1. The internal expression of sizeof () does not participate in the real operation, and the operation value is calculated at compile time.

2. Even if there is an assignment expression written inside sizeof, it will not be done in practice. Sizeof will only look at the type of Operand and will not access the corresponding space.

Example

Int main () {int a = 10 politics int b = sizeof (a = a + 1); printf ("% d% d\ n", a, b); / / 10 4return 0;} C language is a process-oriented, abstract general programming language, widely used in low-level development, using C language can be easily compiled and processed low-level memory.

These are all the contents of the article "how to use sizeof in C language". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.

Tags: Language knowledge article content expression compilation operation different low-level large most memory instance actual that is bottom layer Operand way more knowledge point Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn Xiaomi Shulou Tech Info Apple MariaDB