0
Why don't we use a semicolon in the end of the functions
2 Antworten
+ 2
thanks it helped
0
Actually, semicolon is used to end a line.
For instance, if you do,
int hash [100]={0}, x, s=20;
while (s--) {
cin>> x;
hash[x]++;}
You need to use a semicolon(;)
In order to tell the compiler, that, hey compiler, see this is where I did end this line.
Using functions like
sort(a,a+n) ;
You also need a semicolon.
However, when you write your own function, the function has its space where you write its functionality.
Consider,
return_something dosomething(take_something)
{
}
Hope, this is something that you needed.