C Language Foundation One (tapping the keyboard, looking for information)

Source: Internet
Author: User

Declaration beforehand: All materials are the basis of small, no big difference, if you feel good, you can discuss with each other, after all, I am also a small chick.

Everyone in the C language, C + + similar high-end language, often are to learn and learn, not knowing why and learning, perhaps a better environment ...

And the small part of all the knowledge described without any concept, Real deal Foundation, all by Operation! Even if you are small chicks are small white, or just into the industry of new people.

Remember: Then knock, bag you understand a little! Don't ask what?

C language followed by C + +.

After learning you can write software, write games ... Branches of all walks of life.

No matter what software you use, write a C-language file, it is best to use: file name. C

-------------------------------------------------------------------------------File Contents------------------------------------ --------------------------------------------------

#include <stdio.h>

Main entrance
int main ()
{
Chara = ' C '; Character type
printf ("Char type:%c", a);

SHORTB = 2; Short-integer
printf ("Short Type:%d", b);

Long b2 = 2; Long integer type
printf ("Long type:%d", B2);

INTC = 6; (integer) Integral type
printf ("Int type:%d", c);

FLOATD = 8.0f; (decimal single precision) floating point type
printf ("Float type:%f", D);

Doublee = 7.0; (decimal double precision) floating point type
printf ("Double type:%lf", e);
GetChar (); Pause to prevent the screen from flashing off and you can delete it and run it again to see
}

//------------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------

Please run your software, small series using the visual Studio 2013 compiler, direct F5 (plus debugging).

A black interface pops up a bunch of data, isn't it confusing.

Take a closer look at the contents of the above, and then there are their own original knock on the thing, what is going on?

--------------------------------------------------------------------------------Print Content----------------------------------- -----------------------------------------------

//------------------------------------------------------------------------------------------------------------- ----------------------------------------------------------------

Looks very neat, when you run the one by one control above, you will find that if the content can be written to print, then you write is very neat, how to display a horizontal?

In fact? To say right is also true, want to be more neat point, uncommon again control the picture below to see, there are different.

You will find each printf (inside multiple \ n), run down to see what it will look like?

--------------------------------------------------------------------------------Print Content----------------------------------- -----------------------------------------------

//------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------

Become more neat, is not a bit clear, each line becomes more like you write the thing, it is not difficult to guess what that means?

Just like in Word write a line of text, press a return, the text changed a line, and the above "\ n" means "newline!" ”

Perhaps some people will be more puzzled, what is the use of this? Look at this, you can only print fonts or something, and what is the link to technology?!

You need to know a little better, all the conceptual text is a truth, no text there is no communication, like language, is it all by body language? Well, you're good.

So know a concept: computer language is the language used to communicate with machines.

Looking at what you're writing, why do you write it so that you can print it?

Try to delete the first line of # include <stdio.h> Delete, the other do not delete, all deleted, also do not have to read. Hey.

After the run, what became?

Look up at the bottom of your compiler, are there any warning signs or error flags? Or a pop-up thing. Don't Panic!

Think about it, why is that?

Obviously just can run well, how to become this ghost thing.

Oh, less the one that you deleted just now. What is that?

Please call him "header file!" "Meaning is the head of the file you created. Look at a file as a person.

With a head, the body is the main entrance, what is inside? For the time being, you will notice that this is a process. Gradual!

Oh, is not aware of the usual people say C language will be the process of what what, do not think too much, here is the small part of the understanding.

-----------------------------------------------------------------------Think about the--------------------------------------------- ---------------------------------------------

If it is written as above, it will be printf (which deletes something inside).

For example, after the deletion of text, run to see, or char delete run look, or colon delete run to see, no effect, just print things have changed.

If you delete the contents after the colon:% and C, delete them separately. Well, after the colon, what the hell is this?

If you delete the contents of the double quotation marks, the amount, and then Ah, what ghost?

Is there any association, this is like: Before%c, after a, together exist, you can print the content.

-----------------------------------------------------------------------Summary---------------------------------------------- --------------------------------------------

This is called to tell anything in double quotation marks: There is nothing to use, you can delete, and why write it? It's easy for you to observe and what to suggest.

%c and A are the corresponding relationships, and the content that you want to print out char must be stored in%c. And%c is storing the char data type.

The "a" behind the data type is the so-called variable, which you can customize, the basic rules I will not say.

Other types can then presumably other people say more than I do. Information is the accumulation of their own more and more, remember this!

All things have to learn to find, not just rely on an article can all learn, when you know a few types of meaning, after the back to continue, very little thing, followed by knocking, a line of reading out, and then do, this is the purpose!

-----------------------------------------------------------------------try to print a look at------------------------------------------ -------------------------------------

C Language Foundation One (tapping the keyboard, looking for information)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.