iseng mo nambahin aja...
valid sebagai c++ code (kecuali %i nya, yagn seharusnya "%i"), tapi valid juga sebagai c code, teorinya c code bisa di compile pake c++ compilers walaupun kenyataannya ada beberapa code c yang gak mau di compilecontohna :
#include <stdio.h>
void main(){
int i;
i = 0;
while(1)
{printf(%i,i);
i++;
}
return 0;
}
ini sample yang lebih "berbau" c++, dan gak bisa di compile pake c compilers
#include <iostream>
void main(){
int i;
i = 0;
while(1)
{ std::cout << i << std::endl;
i++;
}
return 0;
}
Share This Thread