Hey, guys. I've decided to learn C++ for fun while we're having some downtime here at work.

I'm using Microsoft Visual C++ and it doesn't explain a couple of bits of basic syntax:

On the line

int main ()

What does "int" stand for? It seems to be used for an integer variable elsewhere. And what are the parentheses for? In case I want to set some parameters?

Thanks!

Tom

Recommended Answers

All 2 Replies

Well , if you have started C++ right now , It would be hard to understand what int main () stands for, Most books explain the code as the place where the execution of the program begins.

And I tend to prefer it to be that way, until you get to "functions" . Once you are pretty much aware about functions , you will see that it all comes into place,
If you have already studied functions suggestion to you would be to consider revising through the book that you are reading and look again into Functions.

For a good reference you could use the basics of functions Here

[EDIT]
AND THEN if you have a doubt, you are always welcome to ask :) [/Edit]

Well , if you have started C++ right now , It would be hard to understand what int main () stands for, Most books explain the code as the place where the execution of the program begins.

And I tend to prefer it to be that way, until you get to "functions" . Once you are pretty much aware about functions , you will see that it all comes into place,
If you have already studied functions suggestion to you would be to consider revising through the book that you are reading and look again into Functions.

For a good reference you could use the basics of functions Here

[EDIT]
AND THEN if you have a doubt, you are always welcome to ask :) [/Edit]

I'm starting the chapter on functions now! I'm sure I'll have a grip on this by the end of the day.

Thanks so much for your helpful reply!

Tom

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.