当前位置:网站首页>C language -- 1 c language cognition
C language -- 1 c language cognition
2022-06-10 21:29:00 【Try!】
Recent preparation and improvement C Language learning , Consolidate foundation .
1、c The content of language learning
- Understand what is c Language
- data type
- Variable 、 Constant
- character string 、 Escape character 、 notes
- Select statement
- Loop statement
- function
- Array
- The operator
- Common keywords
- define Define constants and macros
- The pointer
- Structure
2、 What is? c Language
Language : People communicate with people
Computer language : The language in which people communicate with computers , Such as :c、c++、JAVA etc.
c Language is a general computer programming language , Widely used in underlying development ( namely : Write operating system 、 Drive, etc ).C The design goal of the language is to provide a way to compile 、 Processing low-level memory , Generate a small amount of machine code and a programming language that can run without any running environment support .
C Language has international standards , Such as :c89,c90,c99,c11, Mainly c89 And c90.
3、 How to write c What about the language code ?
Write through the compiler , Its compiler mainly includes :Clang,GCC,WIN-TC,SUBLIME,MSVC,Turbo C etc. . This study is going to use microsoft visual studio 2022, It's the integrated development environment , Integrated MSVC Such a compiler , You can write and compile c The language code .
Write c Procedure steps :
Create a project

Create a source file

Write code , Write a simple one first , Print “c Language learning ”, Write the main function (main function ) And the body of the function
{
return 0;// This part is the body of the function
}
#include<stdio.h>
int main() //int Is the type returned by the function ,main() Is the function name
{
printf("c Language learning ");
return 0;
}
- Compile code + Run code
On the menu bar — debugging — Start execution without debugging ;
Shortcut key fn+ctrl+f5
Shortcut key ctrl+f5
4、 How to execute c Code ?
c The language is executed from the first line of the main function , therefore c Language code lines must have main function ,main Function is an entry , Otherwise, you can't execute .
printf It's a library function , To print information on a screen ,printf The use of is required in advance “ Say hello ” Of , namely : Is to include the header file ,
#include <stdio.h>Set item properties : Stop “ project ” name — Right click “ attribute ”—“ The linker ”—“ System ”—“ Subsystem ” Change the back to “ Console …”

Be careful : There can be multiple in a project .c file , But these multiple .c The file has and can only have one main function
边栏推荐
- Will your company choose to develop data center?
- MySQL Basics
- Leetcode advanced road - 136 A number that appears only once
- Pytorch deep learning -- convolution operation and code examples
- 蛮力法/1~n个整数中取k个整数
- LeetCode 进阶之路 - 加一
- Leetcode advanced road - 167 Sum of two numbers II - input ordered array
- 视频监控系统存储控件,带宽计算方法
- Leetcode divides the array so that the maximum difference is k
- 自制Table表格
猜你喜欢

Redis cache breakdown

Meetup Preview: introduction to the new version of linkis and the application practice of DSS

Niuke.com: numbers that appear more than half of the times in the array

LeetCode:497. Random points in non overlapping rectangles -- medium

app测试用例

保姆级教程:如何成为Apache Linkis文档贡献者

synergy: server refused client with our name

Practical | how to use burp suite for password blasting!

Vissim仿真快速入门

软件测试工程师是做什么的?
随机推荐
Shell implements SSH login and executes commands
1、 Vulkan develops theoretical fundamentals
Leetcode divides the array so that the maximum difference is k
Leetcode advanced road - 125 Validate palindrome string
連接mysql報錯 errorCode 1129, state HY000, Host ‘xxx‘ is blocked because of many connection errors
防抖和节流
Kcon 2022 topic public selection is hot! Don't miss the topic of "favorite"
分布式服务理论基础
Calculus review 1
数据库系统概论 ---- 第一章 -- 绪论(重要知识点)
视频监控系统存储控件,带宽计算方法
蛮力法/任务分配
Nodejs: official document 3 Dgram stream
简解深度学习Attention
01js basic null and undefined difference type conversion = = code block logical operator
CET-6 - Business English - the last recitation before the test
LeetCode 进阶之路 - 169.多数元素
A small case with 666 times performance improvement illustrates the importance of using indexes correctly in tidb
MySQL service startup failed
魔塔类游戏实现源码及关卡生成