C Programming Tutorial 3 - Writing Our First Program - Hello World

In this video we are going to write our first computer program.If you are new to programming, you should know what a Hello World program is.Essentially, a hello world program is a program that says "Hello World" on the screen.The point of this is to have the confidence that you have all of the proper tools installed, everything is set up correctly, you're able to write the most basic program, compile it, and execute it.Essentially, a Hello World program will take you from beginning to the end of writing a program. The very first thing we have to do is create the file that we are going to write all of our code in.vim hello.c the .c at the end of the file is called a file extension.The C means that it is a C file.Make sure you end all of your C files with .c.  Now once we have the editor open, we want to start typing.VIM has different modes, so we actually have to switch to Insert mode.Press i. Now, you can start typing.To get out of insert mode we can press the Esc key.  Now to move your cursor around in your program, you can use your arrow keys.Later on we'll learn some more fancy tricks to navigate, but this is a great way to adjust to using VIM as it's very similar to any other text editor.Just don't tell anybody I told you that.Let's go back into insert mode.Now basically everything I type in this video may be new to you.That is ok!!In the next video I will go over what everything means and by the end of this series this will be a piece of cake.  Once your program is done you can exit vim by typing :wq while not in insert mode.This will write your changes to disk and then quit. now, we need to compile: gcc hello.c Now, let's take a look at the folder we are in by typing ls You can see that we have hello.c, and a.out.a.out is the executable that gcc created.We can now run this to see it in action.To run the program type: ./a.out The ./ is to say that we want to execute something in the current location, and then the name is all we need to run the program. There you go!Congratulations! Now, if you're not so lucky, you'll have some problems with your code and the program will refuse to execute.Always try again!Just remember…if at first you don't succeed, don't try sky diving!Let's see what that looks like by changing some of our code. Now, when we run gcc, we get errors pop up.A lot of this can look like gibberish sometimes, but read it closely. Often it will give you a hint as to where and what is wrong.~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Support me! to my newsletter: ~~~~~~~~~~~~~~~Additional Links~~~~~~~~~~~~~~~More content: Web Hosting -(The best web hosting for a cheap price!)

Ryan C

This just proves you don’t need good grades to have a good life

Adrian

Team coby

Davey Jones

Just an opinion: I never thought the Pac Man occurrence in Tron was meant to be an Easter egg-type occurrence. Since the setting of the most movie was inside computers/video games, it just made sense that actual video game components would be present.

Lachlan Keller

why 3K dislikes?! people must not like frisbee

Josh Marrello

manny machado and O'Day

Noah Morin

Girl, I fell so bad for you

2 views

I've been to that H.E.B.

Fuzz ball Muffin

Someone:Elsa are you not cold?Elsa: no,because if I do, I’ll let it go

neo7372

ownage

Sky's the limits

I was born 2 months early

RomaInvicta

That Cory in the house bit... OH BOY

Ariel Danielle

DAMN IT ASTRO!

[}{]exon

I cant do the / easter egg-- / Geek week ones :(

Let's see if I get to 30 likes and I'll expose panda lol

Ben Richards

Trick shots are only the tip of the iceberg

Well this is how I go and this is how it ends this is what u wanted well

Rafael Ch.

Nice. I really enjoyed this video

Vazerin

I wonder if the 6 characters from Borderlands 2 come in and actually talk and have a part in the game

Aviator

holy shit it actually is christmas

Review scores

mmmoshe levin

Me: okay lets give it a try it cant be that stupid as actually happened

Jose Gonzalez

Didn't sleep Me: Welp time to get my phoneSee's trailerMe: Welp, it's a time to be awake

I know that this comment doesn’t make sense at all but you get it 😪

Wonchewonana Rizal

the voice just gets the hair of my neck stand.

nili ghobadi

💪🏻👌😂

Mayur Rajput

😃😃😃😃😃

احمد العنزي

2:25 in the front :)

Mr. Anyone

That's it ?

Jason Strickland

Y'all should put a ball pit under that swing that that Chad was on

Jimmy Young

Just a copy of many other "experimental" vids. This is something you do in junior high.

Logan Whitesell

Garret heard he had to wear red instead of purple and said "I'll sit this one out"

dizzy xd

The new trailer for Inside Out 2 looks nice!

Ruaa Sawalha

wow!!

Ricardo Alberto

this video make me wanna watch the show, the exact moment i finish this video i was on Netflix looking for it, the next day in the morning i actually finish the first seasson xD

Maggie Cannon

Thay are trickshoty

Austin Smith

i wander how many tries that took

Wang Joel

Rip Tim,he was just flying the helicopter

Jack Jaramillo

Yeah. Go Volleyball.

Maria Ann Wenskoski

team smasher

Payton Heleine

I will never get tired of Guru's video. Keep it up man <3

   

Nested Menu

Main