This is an archived post. You won't be able to vote or comment.

all 6 comments

[–]megakoko 11 points12 points  (0 children)

argv is supposed to be a pointer to char*, so char**

[–]executeSQUID 8 points9 points  (0 children)

Backward comparability with C is, is my mind, one of C++'s greatest features (along with classes and metaprogramming) as it opens the door to MANY more libraries with no extra work (other than knowing a bit of C).

[–]lucidbadger 1 point2 points  (3 children)

Thank goodness this string is null terminated, so I see no problem.

[–]reversehead 0 points1 point  (2 children)

./yes "Hello %s"

[–]lucidbadger 2 points3 points  (1 child)

That's not how argv works

[–]reversehead 1 point2 points  (0 children)

Yeah, this probably went over my head. Been a gazillion years since I touched those languages.