Getting to know C language for the first time———1

        Dear friends, hello everyone, starting today I will continue to update my understanding of learning C language for you, if there is something wrong, I hope you can comment, and I will correct it! Hope to make progress together with my friends! Hope to get your three consecutive~~~

Article directory:

  • What is C language
  • The first C language program
  • type of data

1. What is C language

       Language is a way of communication, and Chinese, English, etc. are the languages ​​for people to communicate with each other. C language is a language for communication between human and computer. It has both the characteristics of high-level language and the characteristics of assembly language. Applications that rely on computer hardware Therefore, it has a wide range of applications, not only in software development, but also in various scientific researches that require the use of C language. Specific applications such as single-chip microcomputer and embedded system development, the latest C language standard is C18.

2. The first C language program

#include<stdio.h>
int main()
{
	printf("The beginning of dreams\n");
	return 0;
}

3. Data type

        In fact, the essence of data type is "alias of fixed memory block size". The size of various data types is fixed. The label is the name of the variable. 

The following are some commonly used data types:

   char //character type
    int //integer type
    short//short integer type
    long //long integer type
    long long //longer integer type
    float //single-precision floating-point type
    double //double-precision floating-point type

Let's calculate their size: 

#include<stdio.h>
int main()
{
	printf("%d\n", sizeof(char));
	printf("%d\n", sizeof(int)); 
	printf("%d\n", sizeof(short));
	printf("%d\n", sizeof(long));
	printf("%d\n", sizeof(long long));
	printf("%d\n", sizeof(float));
	printf("%d\n", sizeof(double));
	return 0;
}

 From the above results, we can see that the essence of the data type is actually "an alias for a fixed memory block size".

So much content this time, the initial C language has just started, after that, I will continue to update, so stay tuned~

If the blogger's article is helpful to you, please pay attention to it, like it, and support the blogger. Thank you for your attention and likes.

Guess you like

Origin blog.csdn.net/LXW0403/article/details/129969419