C compile and run a C program with cmd 🏗️ (optional video)

preview_player
Показать описание
compile and run a c file with command prompt

#C #compile #run

⭐️Time Stamps⭐️
(00:00:00) intro
(00:00:17) Step 0. check if you have a gcc compiler
(00:00:34) Step 1. change directory to folder containing your c program
(00:01:00) Step 2. compile program
(00:01:13) Step 3. run compiled program
(00:01:30) summary

====================
Windows (open Command Prompt)
====================
0. gcc --version (check to see if you have a gcc compiler)
1. cd C:\Users\User\Desktop\C Files (change directory to folder w/ c file)
2. gcc HelloWorld.c (compile c file)

====================
mac OS (open Terminal)
====================
0. gcc --version (check to see if you have a gcc compiler)
1. cd (change directory to folder w/ c file)
2. gcc HelloWorld.c -o HelloWorld (compile c file)
3. ./HelloWorld (run compiled file)

====================
Linux (open Terminal)
====================
0. gcc --version (check to see if you have a gcc compiler)
1. cd (change directory to folder w/ c file)
2. gcc HelloWorld.c -o HelloWorld (compile c file)
3. ./HelloWorld (run compiled file)
Рекомендации по теме
Комментарии
Автор

⭐️Time Stamps⭐️
(00:00:00) intro
(00:00:17) Step 0. check if you have a gcc compiler
(00:00:34) Step 1. change directory to folder containing your c program
(00:01:00) Step 2. compile program
(00:01:13) Step 3. run compiled program
(00:01:30) summary


Windows (open Command Prompt)

0. gcc --version (check to see if you have a gcc compiler)
1. cd C:\Users\User\Desktop\C Files (change directory to folder w/ c file)
2. gcc HelloWorld.c (compile c file)
3. a.exe (run compiled file)


mac OS (open Terminal)

0. gcc --version (check to see if you have a gcc compiler)
1. cd (change directory to folder w/ c file)
2. gcc HelloWorld.c -o HelloWorld (compile c file)
3. ./HelloWorld (run compiled file)


Linux (open Terminal)

0. gcc --version (check to see if you have a gcc compiler)
1. cd (change directory to folder w/ c file)
2. gcc HelloWorld.c -o HelloWorld (compile c file)
3. ./HelloWorld (run compiled file)

BroCodez
Автор

I am never gonna forget this once in a lifetime experience!!! 🙏🏼

Such great movies both of them!!!

sandeeprajput
Автор

Oh! I remmember something like this! Back when I had switched to Linux I had to debug, compile and run a simple C++ script from the terminal, I found it to be far more helpful that the VS console, even if I had to install de compiler at side.

hilken
Автор

I see uh with million subs ... !
Your content is always helpful and fun !

marcushll
Автор

What do type if we want to see content or output of another program, as i see only output of first program after typing a, while in case other i type gcc filename and then a it shows program cannot be executed. Plz reply

RiyasSpecifications
Автор

Love uh Bro !
Always want to be like you... ❤️

marcushll
Автор

Hello Bro, just curious why you did not use the output flag on the cmd prompt, but you did on the linux and mac terminal examples.
You know, you don't have to use the switch, and it will output to a.out (which is the linux and mac terminal version of windows cmd prompt a.exe).
I kind of like compiling without the flag/switch, keeps the folder structure a little neater while learning, notice I didn't even mention make.
Subscribed and pounding the like button.

dogbyte
Автор

you can of course change a.exe to {whatever file name}.exe . I think you can also do ./a to run it, or is that just in the linux terminal ?

edwardmacnab
Автор

Hey Brother! I have a question that which programming language is best to make an ios app for iphone to control Robots/Electronic Devices (For iphone). 🙏🙏

sashaktyadav
Автор

just incase someone has there C files on the D:\ directory and can't change from C:\ to D:\
here is how to do it in the CMD:
cd /d"D:/directory of your file"
for example I had : cd /d"D:\programming projects\C programming\Try"


the key is in that /d, it's used to change directory from a C to D, or F to C, etc...

oximas-oevf
Автор

He bro can u plz explain about extension and about folder like this bit give brief please 🙏🥺📂📁

mfuizud
Автор

i have a question, why does it saves as a C Source File and not C File? Is there a way to fix it?

aldrich
Автор

do you know how to run c and c++ in console in vscode. Thanks <3

thiemhoang
Автор

can you share the nulear codes with me ...?

fxkkicb
Автор

Hello bro
Do u uploaded C programming full tutorial in a single video like python video??

surendharb
Автор

Reg the desc, mac and linux don't have c: drives.

aditya_asundi
Автор

Hey Brother! I have a question that which programming language is best to make an ios app for iphone to control Robots/Electronic Devices (For iphone). 🙏🙏

sashaktyadav