A noob question about C++?
Now i’m learning C++, Truly done possess and I’ve truly always completed my approaches, which are generally basically characteristics, like:
open static emptiness main(String args) //beginning regarding method
//code will go here
//end regarding method.
So will i do characteristics in C++ like that:
int main()
rather of
int main()
or is not an alternative Sorry when this amounts to just a noob issue and MY SPOUSE AND I should just choose what the actual tutorial male says however I wan’t to try and make this just as much like java as you can so that we can farmiliarize myself considering the language a lot quicker:D
C++ is just not python:)
you could write
int main()
or
int
main
(
)
it will compile the identical way
So the goal of formatting is just for others that will evaluate your rule (and for your own, since you’ll probably decide to check out your value years later), next to nothing else.You are able to read about a number of formatting variations and considerations here:
http://en.wikipedia.org/wiki/Indent_style
My own recommendation:possibly be flexible.A lot of companies possess in-house coding fashion guides, that prescribe indent type.As you go from occupation to position, advancing ones career, you will have to change a person’s preferences once or twice.
I was C and C++ guy and i suggest ough yes you are able to write
int main()
The particular white areas doesn’t make any difference.You may quickly but it will not create the particular ambiguity involving brackets.
Maintain program possibly be left indent so it will legible and understandable quickly.
It can be purely a new matter with style
The particular compiler ignores bright space.
i’m keen the
int main(void)
…
style myself — uses less directory space
It will obviously work simply because after int main() your compiler tries to choose the block that contains your code.So I know that the idea won’t give any difficulty.
as far as i know white room is ignored with the complier although i’m a new java man myself so i do think it must work but could possibly be wrong
yes it is possible to.white room doesn’t make a difference.
Enter the addiction of attempting it released, you’ll study faster after that waiting in YA for an answer.
There’s a better way you can figure this kind of out by yourself, and it will take about 40 seconds.
That is not important…any manner works!
Leave a Reply
You must be logged in to post a comment.