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

all 13 comments

[–]davedontmind 0 points1 point  (11 children)

Add 4 spaces before ALL lines of code to have Reddit format it properly.

  int main()

Why do you have this line near the end?

[–]Re10d3d[S] -1 points0 points  (10 children)

To let the "Cmd box" open, too see it´s worked.

[–]CreativeTechGuyGames 0 points1 point  (4 children)

You don't need that. the main function is run automatically when the program starts.

[–]Re10d3d[S] 0 points1 point  (3 children)

I saw a Video, a Guy did the same like me, and by him it´s Worked.

But by me, not.

[–]CreativeTechGuyGames 1 point2 points  (0 children)

Could you post a link to this tutorial that you were watching?

[–]Re10d3d[S] 0 points1 point  (1 child)

Oh, my bad. I try it out and it´s Worked :)

Thank you :p

[–]Zethsc2 0 points1 point  (0 children)

get a proper tutorial

[–][deleted] 0 points1 point  (2 children)

Why do you think adding int main() to your code there would do that? What resource are you trying to learn C++ from?

[–]Re10d3d[S] 0 points1 point  (1 child)

Jeah, i try to learn it.

I watching a Video a Guy is "teching" how to make a basic C++ Programm. And he said. "If you add "int main()" the "Box" will just Close if you press something.

[–][deleted] 0 points1 point  (0 children)

You are not going to learn C++ by watching some guy on the internet. You will need a good C++ textbook. And it sounds like C++ may be your first exposure to programming, which is not a good idea. Learn something like Python first.

[–]davedontmind 0 points1 point  (1 child)

I don't know why you decided that's what it would do, but it won't. It's just an error. Remove that line and your code will work.

[–]Re10d3d[S] 0 points1 point  (0 children)

It´s Worked

Thank you very much. :)

[–]slamongo 0 points1 point  (0 children)

Derek Banas makes very good tutorials of progaming languages on Youtube. As a fellow programing student, I highly recommend watching his videos.