Initial contact with C language

Source: Internet
Author: User

These days to C language has a preliminary understanding, read a lot of grammar knowledge.

#include <stdio.h>

int main ()

{

printf ("Hello world\n");

return 0;

}

This is the first simple program that I have come into contact with, I believe most people start with Hello Word!

In addition to the knowledge of the variable, the name of the variable should not be the same as the keyword, this is easy to understand.

There is also a const keyword, it can make the variable in the program to keep its initial value, as long as the Const keyword is placed before the type of the variable (it is also possible) such as: const int NUM = 7 (variable name is generally uppercase, not mandatory)


A little difference between the scanf and printf functions:

For a double of float, the substitution in printf is%f, but in scanf it is not the same, and in scanf, float is%f,double%lf. In fact, is a double type in the scanf inside the substitution is%lf more than a l, the others are the same!


Can only record so much, this is my 0 basis for the first study, there is no place to hope friends to give some advice ah, in the future I will practice a lot, will be the code on the book first knock it over! Kung Fu is not a conscientious, I will certainly succeed!


Initial contact with C language

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.