Bechitra Bechitra - 1 year ago 45
C Question

Okay with newline before semi-colon?

I'm new to C programming. I write a Basic C code

int t =

Is it going to produce a error?

Well, my questing is like

int x = 9;


int x = //Finish this instruction in 3 lines instead of one!

Both are correct? Can i end a instruction in by using multiple line

Answer Source

Re-written answer after question has been clarified.

Yes, the position of the semi-colon doesn't matter. Whitespace (space, newline, tab) generally don't matter in C. It's not a line-oriented language, where source code must be rigidly structured into lines. There are lines, but they're not very important. Almost always, a newline can be changed into a space (or even removed) without changing the meaning of the code.

These are all equivalent:

int x = 1;

int y=1;

int z=1          ;


You should check out some Obfuscated C entries for how this can be used to creative effect.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download