any pgm will write without using semicolon in c;
any pgm will write without using semicolon in c;
However, the above code is incorrect in that it doesn't return a value which it should.Code:#include <stdio.h> int main() { if (printf("Hello, World\n")) {} }
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
thank u mats;any usefull without using ';'?
Why? Semicolon is part of the language, you "have to" use it. We can contrive examples that show that you can write something fairly complicated without the semicolon, but it's still going to be contrived. You can probably write a long book without using the letter q, but it would be hard work, and only useful in the sense that you can write a long book without using the letter q.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
> However, the above code is incorrect in that it doesn't return a value which it should.
Except under C99.
Here's C89:edit: nevermind, exit returns void.Code:#include <stdio.h> #include <stdlib.h> void func(void) { if (printf("Something")) {} } int main() { if(atexit(func)) {} if(exit(EXIT_SUCCESS)) {} }
Last edited by robwhit; 07-29-2008 at 07:28 AM.
thank u robwhit
It's invalid. Nevermind.
Are you trying to write code without semicolons because your semicolon key broken or something?
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.