10

For example:

void thisIsAnExample(Hello* bye, char* name, int num, in* arr, int* sum){
                 GoodBye x;;
                   x.funName = name;
                    .
                    .
                    .
Bhargav Rao
  • 45,811
  • 27
  • 120
  • 136
mvitagames
  • 403
  • 3
  • 6
  • 16
  • 22
    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
  • 5
    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

14

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
  • 159,194
  • 20
  • 270
  • 458
13

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
  • 25,576
  • 25
  • 124
  • 179
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
  • 443
  • 3
  • 13