The below compiles and runs for me.
No idea if cin works right your sample code does not test that well.I used C::B SVN 5731. Should work with most C::B Nightly reply to this thread if 8.02 release does not work for you. The teacher/instructor would most likely want a set release to test it.
Note: Code::Blocks does NOT support debugging of Borland code; but, about 6 months ago someone mentioned a third party option for Borland debugging no idea if it supported the old Borland 5.5 code.
http://forums.codeblocks.org/index.php/topic,10597.0.htmlhttp://www.ollydbg.de/ an shareware debugger no idea if it really works with Borland Code well or if using it will be easy with code blocks.
Added the libraries "cw32", "Kernel32", and "user32" to get it to link.
Note: the "cw32" library was a random guess.
Improved test code used below to test cin and set valid exit code was returning a weird exit code.
#include <iostream.h>
void main()
{
cout << "works\n";
int a;
cin >> a;
cout << a << "\n";
exit(0);
}
Cmd window output below for me entering a 7
works
7
7
Process returned 0 (0x0) execution time : 2.734 s
Press any key to continue.
Using Borland bcc 5.5 installed in folder "C:\GreenApps\BCC55"
bcc32 -v
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
ilink32.cfg contains
-L"C:\GreenApps\BCC55\lib;C:\GreenApps\BCC55\Lib\PSDK"
bcc32.cfg contains
-I"C:\GreenApps\BCC55\include"
-L"C:\GreenApps\BCC55\lib;C:\GreenApps\BCC55\Lib\PSDK"
Tim S.