What's this for? I'm learning c++

What's this for? I'm learning c++

Other urls found in this thread:

isocpp.org/std/status
github.com/mikebmcl/P0267_RefImpl
open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4656.pdf
twitter.com/NSFWRedditVideo

just google argc argv

a thread died for this

>a thread died for this
Just shut the fuck up. Shut the fuck up, go over at your closest and tallest bridge and put a bullet in your fucking head you fucking faggot. I can't fucking believe this fucking board. Trap and desktop threads are more important than a noob learning about C++? Fuck off. I'm gonna spoonfed this guy so he keeps posting questions here, and hopefully makes your shitty thinkpad threads archive, you fucking fag cocklover.

"argc" is the number of arguments passed when your application is invoked from the terminal. "argv" is an array of strings that contain those arguments.
Name of the program also counts as an argument, so "argc" can't be smaller than 1.

For example, let's say you executed your application from the terminal like this:

your_app -argument1 -argument2


In that case, argc would be equal to 3.
argv[0] would be "your_app"
argv[1] would be "-argument1"
argv[2] would be "-argument2"

It has a lot of historical significance from the unix system, and allows you to write flexible but un-interactive programs easily.

For arguing with SJWs

It's to feed input int your program from the terminal.
/path/to/my/program.exe arg0 arg1 arg2

argc would be 3 and argv would be a pointer to the args.

I got it! Thanks a lot guys

Learn how to google basic shit instead of begging people to be spoon feeding you, fucking moron.

>It's to feed input int your program from the terminal.
>/path/to/my/program.exe arg0 arg1 arg2
>argc would be 3 and argv would be a pointer to the args
You forgot that the first argument is always the program name. Pic related

>not using \n\n

That is unnecessary for you now, you should replace it with an empty pair of parenthesis. You'll learn about it later, when you get to command line arguments.

>Just shut the fuck up. Shut the fuck up, go over at your closest and tallest bridge and put a bullet in your fucking head you fucking faggot. I can't fucking believe this fucking board. Trap and desktop threads are more important than a noob learning about C++? Fuck off. I'm gonna spoonfed this guy so he keeps posting questions here, and hopefully makes your shitty thinkpad threads archive, you fucking fag cocklover.
oh boy that's a sick ass burn

i love when common decency shows up on Sup Forums, even if it is rare

>Just shut the fuck up. Shut the fuck up, go over at your closest and tallest bridge and put a bullet in your fucking head you fucking faggot. I can't fucking believe this fucking board. Trap and desktop threads are more important than a noob learning about C++? Fuck off. I'm gonna spoonfed this guy so he keeps posting questions here, and hopefully makes your shitty thinkpad threads archive, you fucking fag cocklover.

SAVAGE

*claps*


I guess we can turn this into a general C++ thread now. What is the deal with them adding a 2D graphics API to the standard with io2d?

Wait, what? I didn't hear about this. Which standard? 17?

And to tack onto this question, why is the Linux impl based on GTK3 when the LSB only requires GTK2? Wouldn't it have been better to target GTK2 ot QT4.2?

Looks like it is slated for C++20 isocpp.org/std/status github.com/mikebmcl/P0267_RefImpl

>Name of the program also counts as an argument, so "argc" can't be smaller than 1
There are (admittedly esoteric) circumstances in which argc can be 0.

More importantly, why HAVEN'T they added a high level networking API? C sockets are shit and every third thing about them is redundant information. Blocking by default is dumb.

> Soon
open-std.org/jtc1/sc22/wg21/docs/papers/2017/n4656.pdf

I guess I'll just keep using boost.asio and C sockets for the forseeable future. It's an excuse to teach myself threads, I suppose.

>shitty thinkpad threads archive
hHhey now, those threads are ok!

hopefully it was a mr robot thread

execve isn't that esoteric tbqh tho

>"argc" is the number of arguments passed when your application is invoked from the terminal
Why? Can't you just count the numbers of arguments from argv? like
argv.count();

If you don’t know:

look at the type: char ** i.e.: an array of char pointers. it’s just an C array, i.e.: a contiguous group of char *s argc long.

That’s it.

It’s not an object, it’s not any kind of anything other than Plain Old Data.

if you’re trolling:

put your balls in a garlic press you odorous wad of sphincter cheese.

Arrays are primitive holdovers from C, they don't carry extra data like a length or anything.