11

For example:

void thisIsAnExample(Hello* bye, char* name, int num, in* arr, int* sum){
                 GoodBye x;;
                   x.funName = name;
                    .
                    .
                    .
Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
mvitagames
  • 413
  • 3
  • 6
  • 16
  • 23
    It means someone accidentally typed an extra semicolon... – John3136 Feb 28 '14 at 05:48
  • It doesn't mean anything other than that there is a null statement - probably just a typo. – Paul R Feb 28 '14 at 05:48
  • but the code seems to be working fine?? – mvitagames Feb 28 '14 at 05:49
  • 5
    Sometimes a **semicolon** is just a **semicolon**. – Elliott Frisch Feb 28 '14 at 05:51
  • 1
    These first three tags led me to believe that a complicated answer was coming... – Brian Tracy Feb 28 '14 at 05:53
  • 6
    Those voting to close this as a typo miss the point of that close reason. This is not code that's broken because of a typo. Nor is it a question others are unlikely to have because they wouldn't make this same typo. Rather, this is a legitimate question about working code and why it works, despite unfamiliar syntax. – Rob Kennedy Feb 28 '14 at 05:54
  • Came here because someone else made a typo. It shouldn't have been closed. – heretoinfinity Jul 06 '21 at 21:03
  • To add to the confusion a bit, it's worth mentioning that `;;` _does_ have an actual meaning when declaring a for loop: https://stackoverflow.com/questions/16113125/two-semicolons-inside-a-for-loop-parentheses Making this comment in case anyone else comes here while looking for that for-loop syntax, because this question is right next to the other one in Google's search results. – AmphotericLewisAcid Dec 01 '21 at 22:33

4 Answers4

15

It doesn't mean anything. It's just an extra semicolon. You can delete it (leaving a single semicolon) without any effect on your program.

Rob Kennedy
  • 161,384
  • 21
  • 275
  • 467
15

It has the meaning of an a statement followed by an empty statement.

In C each statememnt ends with ;. So a statement with a ; followed by one, is a statement followed by an empty statement.

oz123
  • 27,559
  • 27
  • 125
  • 187
4

A "double semicolon" does not have any special meaning in c. The second semicolon simply terminates an empty statement. So you can simply remove it.

theldoria
  • 378
  • 9
  • 22
0

Most likely a typo. Adds a null statement to your program.

turing_machine
  • 473
  • 3
  • 13