Uhh... Stadazi, I think you missed the point. It depends on which compiler you use - /to strictly define main to return int/. Once upon a time, I used TC and TC didnt have that problem. If you rewrite the code into this
#include <cstdio> #include <iostream> #include <cstdlib> using namespace std; int main() { int allowed=1; /* /* */ allowed=0; // */ printf( allowed ? "yes\n" : "no\n" ); system("pause"); return 0; } and run it, it will show 'no' instead of 'yes', in the most compilers. thats because the compiler uses stack (may be), like .. 1. /* inserted 2. looking for a */ 3. got one .. turn everything within it into commented in. thats why atamyrat had to comment out */ cause without that it will show compile error! fahim [EMAIL PROTECTED] wrote: > Atamyrat Hezretguliyew wrote: > >> #include<stdio.h> >> void main() { >> int allowed=1; >> /* /* */ allowed=0; // */ >> printf( allowed ? "yes" : "no" ); >> } >> >> please correct me if there's smth i missed. >> >> > you missed that main is strictly defined as a function returning int :-) > > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/algogeeks -~----------~----~----~----~------~----~------~--~---