In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
How to use vi new CentOS mytest file to learn c language programming, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain in detail, people with this need can come to learn, I hope you can get something.
The characteristics of CentOS mytest system can be used not only as CentOS mytest learning for computer majors in colleges and universities, but also for CentOS mytest system open source enthusiasts and XX system users.
First create a new CentOS mytestc.c file using vi.
And enter the relevant c program code as follows: [OK_008@CentOS4 ~] $vi CentOS mytestc.c#include "stdio.h" in main () {printf ("Hello,this is my first program.");} "CentOS mytestc.c" [New] 5L, 77C written starts compilation. Gcc is mainly used for compiling the Calgary Cobb + program. Only the simple parameters-o and-g of gcc are used here. O indicates the name of the set output file.
G means to add mode information and prepare [OK_008@CentOS4 ~] $gcc-o CentOS mytestc-g CentOS mytestc.cCentOS mytestc.c:2: error: syntax error before "main" compilation error for gdb, prompting the syntax error before "main", and then use vi to modify it here. It is found that the data type int before main () is written as in. Oh, it's too careless. [OK_008@CentOS4 ~] $vi CentOS mytestc.c#include "stdio.h" int main () {printf ("Hello,this is my first program.");}
"CentOS mytestc.c" 5L, 78C written [OK _ 008@CentOS4] $gcc-o CentOS mytestc-g CentOS mytestc.c [OK_008@CentOS4 ~] $ls-there is no hint, indicating that the test passed, using ls, we find that there is an extra compiled CentOS mytestc file now.
Debugtest Desktop CentOS mytestc.c mytxt.txt TestFiledebugtest.c CentOS mytestc mytxt1.txt OK008Filed untar [OK _ 008@CentOS4 ~] $. / CentOS mytestc-- this command executes the CentOS mytestc file you just generated. Hello,this is my first program. [OK _ 008@CentOS4] $- here is the execution result. Ok succeeded. In order to look good, I modified the program and added an enter. [OK_008@CentOS4 ~] $vi CentOS mytestc.c
# include "stdio.h" int main () {printf ("Hello,this is my first program.\ n");} "CentOS mytestc.c" 5L, 80C written [OK_008@CentOS4] $gcc-o CentOS mytestc-g CentOS mytestc.c recompile [OK_008@CentOS4 ~] $. / CentOS mytestcHello,this is my first program. Success. [OK_008@CentOS4 ~] $
There is no use of gdb debugging tools to adjust the code, and you can make and makefile to complete automatic maintenance compilation work, the function is good.
Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.