What does int argc, char* argv[] mean?
Vložit
- čas přidán 9. 01. 2015
- In this tutorial I explain the meaning of the argc and argv variables that are often passed in the main function of a C or C++ program.
Want to learn C++? I highly recommend this book amzn.to/1PftaSt
Donate - bit.ly/17vCDFx
STILL NEED MORE HELP?
Connect one-on-one with a Programming Tutor. Click the link below:
trk.justanswer.com/aff_c?offe...
:)
Argc is ARGument Count and and argv is ARGument Vector.
And "Vector reffers to an array, not a C++ or Euclidean vector"
See reference here:
www.cplusplus.com/articles/DEN36Up4/
Ps.: Although the name of the site be cpluplus.com, all the teachings contained there are compatible with C.
Kingsman is KINGdom's MAN.
is he managing directory by programming ?
what are counts and vectors in C?
@@hetaeramancer I tried to print the argv it shows the path of some designated file
I couldn't understand this for so long, I read some stack overflow, watched some tutorials, looked up some problems and nothing helped until I found this video, great explanation!! Feels way better to finally understand this
Hey Paul, I'd like you to thank for putting your energy into making this tutorial. It was really enlightening and it made me comprehend the concept much better. Keep up the awesome job.
Never understood it until I saw you video 👌👍
I want this guy to explain literally everything in my life
You CAN declare a variable inside a for loop in C. Just use C99 or C11.
@Artem Katerynych It's a standard that the compilers have to follow. it's not a version
@Artem Katerynych Well technically we're both late.
@@nicolareiman9687 yes
@@nicolareiman9687 it is a version, if you define it to be "[a] particular form or variation of an earlier or original type" (American Heritage Dictionary, 5th Edition). It's not a version of a particular C implementation -- such as a compiler or standard library -- but it is a version of the C language.
Edit: And I'm also a year late, lol.
i was about to. To be honest i dont get why ppl dont use c99. I just dont get it. If anyone can explain i will apreciate it alot
You are literally the best my professor expected most of us to know c and it took me about 2 weeks on an assignment because i couldn't figure this out but bc of u i have been able to solve the task on the assignment. Thank u.
This scared me in the past to start with c++, but it's actually such a simple concept.
Thx Paul.
I recall Jullian Assange saying, "commitment requires sacrifice, courage is contageous". (The latter meaning if you surround yourself w/ your peers, courage is contageous).
This said, while learning to code, (we're ALWAYS students however), we forget previous lessons etc, the "commitment" part is, constantly reviewing what we may forget.
This said, THANK YOU for your great work here on CZcams.
Cheers
T
This is the clearest explanation I have ever seen on this particular item !
Man, you are amazing! You really know what you're doing. Please, don't stop!!!
I remember being so intimidated by this when I started learning C++. But then I learned that I didn't need it at all and I forgot about it completely.
so do i have to learn this or what bro i am a cs student who are a completely beginner :)
@@ibrahimozmen9668 unless you are building commandline applications for Linux or old terminal based systems, you don't need to worry about it.
@@mistakenmeme thanks bro. I just wanted to learn how it works
Awesome video! I'm brazilian and I want you to know that your video are healping people from all around the world! Thank you very much!
Quite a lucid explanation. Thanks Paul for making such an awesome video. You've gained a subscriber.
I have been searching so much for this, even my book doesn't explain what is this, thx a lot
This video was so helpful with understanding my embedded systems homework. Your video really clears some things up. Thanks so much!
Thank you for your video! I'm French and it's super easy for me to understand everything. You took your time to be understandable and thank you so much for that!
Brilliant explanation, Paul! You just got yourself a new subscriber!
SO WELL-EXPLAIN that I just signed in to give you a thumb-up!!! Thank you for the clear explanation.
That's very simple by listening you. Love the away you explain think. Nice work
Oh my god you are my hero!!! thank you so much bro... subscribed already
Very clear, concise, to the point, intelligible. Many thxs
Paul, A nice clear intelligent presentation.
Well done and thank you!
(Props also to Hassanin Ahmed, below.)
Thank you very much. The video was clear, easy to understand, and helpful!
Cool, this confirmed my book seemed weird that it said this had to double check. good job.
so clear and excellent explanation.
Just to mention that the arguments must have a space or TAB between them and not a ; or ,
You are better at explaining than my actual teachers. +1 sub
maybe you mean sub++ ( I know, I'm not funny)
OMFG I was reading about this for like 1 hours and couldn't understand shit, and you made it so clear!!! Thank you!!
excellent explain.
always provide notes to things you have spoken makes us understand better okay 👍
thank u so much for your efforts
love from india
Well explained Paul. Thanks.
Thanks Paul for this insightful video 😊.
Explicitly explained! Thank you paul!
Thank you, very clear and concise explanation.
finally the first helpful vid on this topic!
No words to explain. !!! Thanks a lot!!!!!
EXCELLENT video, just subscribed. thanks
thanks, i sleep thru my last lecture, this clears a lot!
You just got a new subscriber thanks Paul
I learn something today! Good explanation. Thanks!
Thank you for this excential explanation!!
perfect lecture!~thank you, Paul~~~~~
Perfectly explained, thx a lot bro!
You explained this way better than my teacher.
Thanks, this has confused me and I have it on my exam. You cleared it up :)
Thanks for this tutorial!!! It helps a lot!
You are just amazing bro, thank you so much, you helped me a lot!
Mindblowing! First I wondered what it was in Java, then in C# and now I finally got the answer in C++ :)
it's actually C
@@frogsam4228 it's identical in this case
@@adamodimattia Idk tbh bcz I know nothing about c++
but I'm sure that the format of main itself is different also the standard library is iostream right?
so I guess they can't be identical right
@@frogsam4228 it is, but also in C++ you can use everyting what is in C, all the C libs too
@@adamodimattia ooh I didn't know that
thanks a lot
Did you make a C programming tutorial? You explanations are so clear
good explanation. well understood. thanks man
This is great! thanks from India paul
Great explanation, Thank you so much!
good one
i can put scanf back on the shelf and just pass values in when i run stuff
many thanks for sharing your knowledge
subbed
Thank you so much! Very clear explanation.
Thanks works fine. Greetings from Italy
Bro holy shit. I misunderstood arg c and argv when i first heard it. But god damn now i finally know how to use it. Thank you so much
Thank you so much for this video ! it really helped me !
Thanks for the explanation, God bless you!!!
(In C programming it is not necessary to put in a for loop the type of the value...) Very good tutorial!!
Really helpful, thanks!
Great explanation, most of the university professors can't explain this.
Thank you. Your teaching had a very clear progression from basic code to more complex code.
thanks a lot!!! so nice reverb
excellent examples and explanations cheers!
Wow makes so much sense now. Thank you!
Thank you so much for the help!
From ALX AFRICA
Nice Explanation!
great explanation!
This was very helpful, thanks!
Bro, thanks for details explanation.
Thank you very much! This is well explained! :)
Thanks so much dude,it really helps me in terms of my final...
best video explaining this! thank you
Very good explenation!
Great explanation, thanks.
Great, thanks for the explanation!
BRAVO! Thanks so much sir.
I'm new in porgramming and this video show me for what is this argc and argv. But for what need argc to count his own call from the elter process?
Thank you this helped me a lot!
Thanks for the explanation I get it, but why is it required? What happens in the background process?
great explanation
understood in one go...
Thanks it is very well explained
fantastic explanation!
Great tutorial!
This was awesome!
Wonderful explanation! Thanks.
I have only seen
The way I understand it
- int main(int argc, char* argv[]) is like saying
data_type array_name[]
-int main(int argc, char* argv)
This one takes a string called argv instead of an array. Since string is declared as char* string
- int main( int argc, char **argv) uses a pointer concept
Check this www.programiz.com/c-programming/c-pointers
Thank you. Pretty decent explanation.
Real savior!!!! Thank you!!!!
My friend, in C you can declare "int i=0" in the for loop. Wish you the best!
Alexandru Dinu yes, but that variable would be deleted as soon as the for loop finishes!
@@ledues3336 Can you please explain a bit more? or point to the right source? Because CS50 does the same as Alexandru mention above.
@@ledues3336 Yes, this is the intent.
really helpful, although the if loop seems unnecessary. If the argc
great explanation
Thanks super clear explanation !
Great explanation, thx!
very very good video helped a lot thanks dude :)
Well and clear explanationn...
how would you do this with displaying different image files? like if i want a dog picture, then when i run the code again i want a mountain image from the command prompt
i always declare variables in for loops in c
So clear and simple ❤
What is -o😂
@@user-hh9xc8ut3dum... "Output" maybe?
perfect video which helped me a lot
Subscribed! Thank you! :D