[C语言第一课]入门第一个程序及环境搭建

oncedreame
2021-04-11 / 27 评论 / 287 阅读 / 正在检测是否收录...
一个全新的想法和学习方向,我和大家一起学习编程,我学多少我发多少,更新进度根据我的理解能力跟进(可能会比较慢哈)好了废话不多说,现在开始!
一、安装

进入开发环境的官网下载所需文件官网:http://mingw-w64.org/

然后点击导航栏的Downloads跳转下载页面

点击图中箭头所点的方向选择SourceForge

滑道最下面可以看到上图

点击MinGW-W64-install.exe跳转下载

下载完成后打开应用程序

安装步骤看下图





二、环境编辑

前往安装目录所在位置可看到以下内容:

然后记下图中这个目录下面的步骤有用

在桌面右键此电脑点击属性中的高级系统设置

点击环境变量

编辑 Path 环境变量


然后找到刚才记住的那个地址C:mingwmingw64bin复制到新建的Path环境变量中

安装完成可通过运行查看是否安装成功

Win + R 运行 cmd 在黑框框里输入gcc -v可以看到安装GCC版本


到此C语言的编译环境就搭建完成了,下面还需要一个编辑代码的软件,实际上windows自带的记事本也可以但是没有代码缩进和代码高亮功能不是很直观,所以推荐使用notepad++这个简洁的软件。
下载地址百度一下就有就不演示了哈!

在桌面新建一个记事本文件命名为.c结尾的后缀,为C语言文件。


第一个程序代码如下:

#include <stdio.h>
int main()
{
    printf("Hello World!");
    return 0;
}

打开Win + R输入cmd运行因为我的代码文件创建在桌面为1.c

所以我直接输入cd desktop目录指向桌面

然后再次输入gcc 1.c编译文件之后就会出现a.exe执行文件

再次输入a.exe即可运行执行文件,就会出现一行英文Hello World!

恭喜你运行了第一个程序!

写在最后

好了这是第一个程序的运行及安装就到这里了!我还要去学下一个了,等着我更新哈!

4

评论 (27)

取消
  1. 头像
    delta 8 thc
    Windows 10 · Google Chrome

    Excellent post. I was checking constantly this blog and I'm impressed!
    Extremely helpful information specifically the last part :) I care for such info much.
    I was looking for this particular information for a long time.
    Thank you and good luck.

    回复
  2. 头像
    where to buy CBD
    Windows 10 · QQ Browser

    Hi! Someone in my Myspace group shared this website with us so I came to take a look.
    I'm definitely loving the information. I'm book-marking and will be tweeting this to
    my followers! Superb blog and wonderful design and style.

    回复
  3. 头像
    delta 8 thc near me
    Windows 10 · MicroSoft Edge

    Great site you've got here.. It's hard to find quality writing like yours nowadays.
    I truly appreciate individuals like you! Take care!!

    回复
  4. 头像
    CBD gummies for sale
    Windows 10 · QQ Browser

    I couldn't resist commenting. Exceptionally well
    written!

    回复
  5. 头像
    delta 8 THC area 52
    Windows 10 · QQ Browser

    Its like you read my mind! You appear to know a lot about
    this, like you wrote the book in it or something.
    I think that you can do with some pics to drive the message home a bit, but other than that, this is magnificent blog.

    A great read. I will definitely be back.

    回复
  6. 头像
    CBD gummies for pain
    Windows 10 · Google Chrome

    It's actually very complicated in this active life to listen news on Television, therefore I only use the web for that reason, and get
    the most recent news.

    回复
  7. 头像
    cbd gummies
    Windows 10 · Google Chrome

    I do not know if it's just me or if everybody else encountering issues with your
    site. It appears as if some of the text on your posts are running off the screen. Can somebody
    else please comment and let me know if this is happening to them too?
    This may be a problem with my internet browser because
    I've had this happen before. Cheers

    回复
  8. 头像
    buy delta 8 THC area 52
    Windows 10 · Google Chrome

    With havin so much content and articles do you ever run into any problems of
    plagorism or copyright infringement? My website has a lot of unique content I've either created myself or outsourced but it appears a lot of it is popping
    it up all over the internet without my authorization. Do you know any methods to help prevent content from being ripped off?
    I'd really appreciate it.

    回复
  9. 头像
    delta 8 area 52
    Windows 10 · Google Chrome

    Link exchange is nothing else except it is only placing the other person's blog link on your page at proper place
    and other person will also do same in favor of you.

    回复
  10. 头像
    area 52 delta 8 THC products
    Windows 10 · Google Chrome

    At this time I am ready to do my breakfast, later than having my breakfast
    coming over again to read further news.

    回复
  11. 头像
    CBD gummies for anxiety
    Windows 10 · QQ Browser

    I am sure this paragraph has touched all the internet people, its really really good piece of writing on building up new
    weblog.

    回复
  12. 头像
    delta 8 thc
    Windows 10 · QQ Browser

    Asking questions are in fact nice thing if you are
    not understanding anything entirely, except this piece of writing offers fastidious understanding yet.

    回复
  13. 头像
    delta 8 area 52
    Windows 10 · Google Chrome

    If some one desires expert view concerning running a blog after that i recommend him/her to
    visit this website, Keep up the fastidious
    work.

    回复
  14. 头像
    cbd gummies
    Windows 10 · QQ Browser

    Thanks a bunch for sharing this with all folks you really know what
    you are talking about! Bookmarked. Please additionally discuss with my web site =).
    We will have a link alternate arrangement among
    us

    回复
  15. 头像
    gold bee
    Windows 10 · Google Chrome

    Hello my loved one! I want to say that this article is amazing,
    nice written and come with almost all important infos.
    I'd like to look extra posts like this .

    回复
  16. 头像
    gold bee
    Windows 10 · 360 Fast Browser

    I think this is among the most significant info for me.
    And i am glad reading your article. But wanna remark on some general things,
    The site style is ideal, the articles is really great :
    D. Good job, cheers

    回复
  17. 头像
    gold bee
    Windows 10 · Google Chrome

    Heya i'm for the primary time here. I found this board and I to find It truly helpful & it
    helped me out a lot. I hope to provide one thing again and help others such
    as you helped me.

    回复
  18. 头像
    best CBD
    Windows 10 · Google Chrome

    Greetings from Carolina! I'm bored to death at work so I
    decided to browse your website on my iphone during lunch
    break. I enjoy the info you present here and can't wait to take a look when I get home.

    I'm shocked at how quick your blog loaded on my cell phone ..
    I'm not even using WIFI, just 3G .. Anyways, great blog!

    回复
  19. 头像
    Authesk
    Windows 10 · Google Chrome

    [url=http://vsviagrav.com/]viagra[/url]

    回复
  20. 头像
    buy instagram followers
    Windows 10 · QQ Browser

    It's in fact very complex in this busy life to listen news on TV,
    thus I only use world wide web for that purpose, and
    obtain the most recent information.

    回复
  21. 头像
    DanielAbelp
    Windows 10 · Google Chrome

    [b]Visit [url=https://comparingandcontrastingessay.blogspot.com/] buying essays [/url] [/b]

    [url=https://comparingandcontrastingessay.blogspot.com/][img]https://1.bp.blogspot.com/-KUvGbCt7ZY0/YDtSdyISjuI/AAAAAAAAAHs/Tb2t2pKhKAshxz6ZcmJIW5x9I64ga6yqQCLcBGAsYHQ/s0/6.png[/img] [/url]

    Sep В The Parts of a College Essay Introduction.Read reviews, book instantly and earn rewards.
    professional essay writers review [url=https://comparingandcontrastingessay.blogspot.com/2021/03/how-to-write-essay-for-psychology-essay.html]How to write an essay for psychology Essay Writing[/url] Our writers will write your essay.An illustrative essay is probably one of the easiest types of essays to write; and once you have mastered this type of writing, just .
    the best essay writer
    write my essay fast
    step to write an essay
    how to write personal essay
    how to write research essay
    how to write ethics essay
    write an essay about jogging
    how to write comparison essays
    write an essay in spanish
    to write a good essay
    how to write conclusion essay
    write a essay on environment
    step to write an essay
    how to write general essay
    how to write comparison essay
    write an essay for you

    [url=https://www.facebook.com/How-to-write-a-comparing-and-contrasting-essay-100297298844414] how to write a comparing and contrasting essay [/url]
    [url=https://twitter.com/LarisaRubanova/status/1379003117451218945] essay writings essays writer [/url]

    回复
  22. 头像
    best delta 8 thc products
    Windows 10 · UC Browser

    What a stuff of un-ambiguity and preserveness of valuable experience on the topic of unpredicted emotions.

    回复
  23. 头像
    area 52 delta 8 THC products
    Windows 10 · 360 Fast Browser

    Hi there, yeah this article is really good and I have
    learned lot of things from it on the topic of blogging. thanks.

    area 52 delta 8 THC products - area 52 delta 8 THC products

    area 52 delta 8 THC products - Area 52 delta 8
    carts

    delta 8 area 52 - delta 8 THC for sale area 52

    area 52 delta 8 THC products - Area 52 delta 8 carts

    Area 52 delta 8 carts - delta 8 area 52

    回复
  24. 头像
    delta 8 thc vape
    Windows 10 · Google Chrome

    I am regular visitor, how are you everybody?
    This piece of writing posted at this site is truly good.

    回复
  25. 头像
    delta 8 carts Area 52
    Windows 10 · QQ Browser

    Undeniably believe that which you stated. Your favorite reason seemed to be
    on the web the simplest thing to be aware of. I say to you, I certainly get annoyed while people consider worries that they plainly do not know about.
    You managed to hit the nail upon the top and also defined out the whole thing without having side effect , people
    could take a signal. Will probably be back to get more.
    Thanks

    delta 8 carts Area 52 - delta 8 carts Area 52

    delta 8 carts Area 52 - delta 8 THC for sale area 52

    area 52 delta 8 THC products - delta 8 THC area 52

    Area 52 Delta 8 THC - delta 8 carts Area 52

    buy delta 8 THC area 52 - delta 8 carts Area 52

    回复
  26. 头像
    buy delta 8 THC area 52
    Windows 10 · Google Chrome

    Very energetic article, I loved that bit. Will there be a part 2?

    buy delta 8 THC area 52 - buy delta 8 THC area 52

    buy delta 8 THC area 52 - delta 8 THC for sale area 52

    buy delta 8 THC area 52 - Area 52 Delta 8 THC

    delta 8 THC for sale area 52 - delta 8 carts Area 52

    delta 8 area 52 - delta 8 carts Area 52

    回复
  27. 头像
    Area 52 Delta 8 THC
    Windows 10 · Google Chrome

    Great blog here! Also your website loads up fast! What web host are you using?
    Can I get your affiliate link to your host? I wish my site loaded up
    as quickly as yours lol

    Area 52 Delta 8 THC - Area 52 Delta 8 THC

    Area 52 Delta 8 THC - buy delta 8 THC area
    52

    delta 8 THC for sale area 52 - area 52 delta 8 THC products

    delta 8 area 52 - Area 52 Delta 8 THC

    Area 52 Delta 8 THC - Area 52 Delta 8 THC

    回复