Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does double semicolon mean in c? [closed]

Tags:

c

pointers

struct

For example:

void thisIsAnExample(Hello* bye, char* name, int num, in* arr, int* sum){
                 GoodBye x;;
                   x.funName = name;
                    .
                    .
                    .
like image 365
mvitagames Avatar asked Feb 28 '14 05:02

mvitagames


People also ask

What does for with 2 semicolons mean?

Two semicolons can also occur in for loops: for(;;) { ... } In this case, all three 'slots' are empty, nothing is initialized, or incremented, and there's no condition for when the loop should run. This is a way to write an eternal loop that can only be left from inside the block with a break statement.

How do you use a double semicolon?

Rules for Using SemicolonsUse a semicolon between two independent clauses that are connected by conjunctive adverbs or transitional phrases.

What does semi colon mean in C?

Semicolons are end statements in C. The Semicolon tells that the current statement has been terminated and other statements following are new statements. Usage of Semicolon in C will remove ambiguity and confusion while looking at the code.

Are the conditions inside a for loop separated by semicolons?

The for loop has 3 components, separated by semi-colons. The first component runs before the looping starts and is commonly used to initialize a variable. The second is a condition. The condition is checked at the beginning of each iteration, and if it evaluates to true, then the code in the loop runs.


2 Answers

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.

like image 187
oz123 Avatar answered Sep 30 '22 03:09

oz123


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.

like image 25
Rob Kennedy Avatar answered Sep 30 '22 02:09

Rob Kennedy