Hi, Just wondering if Borland C++ Compiler version 5.5 works for C language also? If not, can u plz refer me with a similar free C compiler? Thanx
Our latest ANSI C/C++ compiler technology, the Borland. C++ 5.5 Compiler ... Yes it works for C. Others: LCC-Win32 http://www.cs.virginia.edu/~lcc-win32/ GCC http://gcc.gnu.org/ Bloodshed (uses Mingw port of GCC) http://www.bloodshed.net/devcpp.html
Bloodshed has a screenshot here: http://www.bloodshed.net/images/devcpp5_scr.jpg Seriously doubt you will see screenshots for GCC or LCC-Win32 since IIRC those are command line. If you are looking for IDEs, that's a totally different requirement.
ok I downloaded Bloodsheed Dev C++ I am trying to run this code #include <stdio.h> int main() { printf("\n"); printf("Hello World"); printf("\n"); } Code (markup): It compiles ok, and a DOS screen comes for a few milliseconds and disappears. Why is this hapenning? And How/Where do I see the output? Sorry, I am new to C. Thanx
Its doing exactly what its supposed to do. And that is creating a dos application that prints hello world. If you want to actually see the output you will have to go to a DOS Prompt. Change directory to whereever you compiled the file and type its filename to see the output. Here's the steps: open cmd from Start>Run cd dev-cpp project2.exe That assumes you have bloodshed installed on the C: drive. If you select windows application from the Project list it will show a bare windows app.
Program runs and screen disappears becuase you have to hold the program for a while for certain action, because it quits when function main has completed. #include <stdio.h> #include <conio.h> int main() { printf("\n"); printf("Hello World"); printf("\n"); [B]getch();[/B] } Code (markup): Most recomended : mingw-gcc that comes alongwith DEV C++ IDE. I am using it since 5 years. I even do windows programming using this IDE. I hope it helps. regards
CodeBlock is a great compiler, the program executed fine, it finishes so fast you can't see it. You need to have a loop so it keeps going, or ask for input so, you can see the output.
Hi That getch(); helped. Can some one please explain me the difference between: 1) int main() 2) void main() 3) main() Thanx
int main() - is right, and program should have a main function returing integeger back to system. void main() - is not right but few compilers change it bacn to int main() when compiling. main() - only using main() without return type was once accepted and compilers used to accept such functions, but still made it int miain() when compiled. So, solution is, use int main() nothing else, but when writing windows programs (non-console), it is different story, you need to use int WindMain(). Few compilers like mingw-gcc do accomodate int main() in windows programs too, but it is not recomended. CodeBlocks is not a compiler, but an IDE that integrates mingw-gcc with it already, just like DEV C++. Please do not feel my words rude or offensive, it is my duty to correct nw programmers, so that they are not mislead in future. regards
Lol, no offense taken. I'm not a new programmer, just a careless mistake. I think I can provide a simpler explanation. int main() basically is the main function that runs when you run the program, everything goes into that function. The Int is just Integer that is returned to see if the program was successful. If it was successful you return 0.