Questions tagged [turbo-c]

Turbo C was an Integrated Development Environment and compiler for the C programming language from Borland, released in 1987. It had been re-release as freeware version 2.01 by 2006.

First introduced in 1987, it was noted for its integrated development environment, small size, fast compile speed, comprehensive manuals and low price.

Today, Turbo C is considered obsolete. It is a 16-bit compiler for DOS environments, and as such cannot access more than 640 KB of memory (and even that only with difficulty), and cannot interoperate with 32- and 64-bit code in modern operating systems. Additionally, due to its age, its standard library differs in some significant fashions from modern C libraries. Plainly put, it is not an appropriate tool for many development tasks today.

Despite this, it is sometimes used in introductory C programming courses, particularly in India. Students using Turbo C should keep its limitations in mind.

273 questions
45
votes
3 answers

Cannot write to screen memory in C

I am very new to C, it's my second high-level programming language after Java. I have gotten most of the basics down, but for whatever reason I am unable to write a single character to screen memory. This program is compiled using Turbo C for DOS on…
Ampera
  • 440
  • 4
  • 13
26
votes
5 answers

Why the range of int is -32768 to 32767?

Why is the range of any data type greater on negative side as compare to positive side? For example, in case of integer: In Turbo C its range is -32768 to 32767 and for Visual Studio it is -2147483648 to 2147483647. The same happens to other data…
VJain
  • 1,027
  • 7
  • 17
  • 37
14
votes
7 answers

What is wrong with using turbo C?

I always find that some people (a majority from India) are using turbo C. I cannot find any reason to use such outdated compiler... But I don't know what reasons to give when trying to tell them to use modern compiler(gcc,msvc,...).
Nyan
  • 2,360
  • 3
  • 25
  • 38
12
votes
2 answers

Could someone please explain what this inline #define assembly is doing?

I'm an occasional C programmer. I've come across this bit of inline assembly code in a Turbo C program #define ADC(dst,src) { asm MOV AX, dst; asm ADD AX, src; \ asm ADC AX, 0; asm MOV dst, AX; } dst and src are both unsigned…
Jim C
  • 165
  • 8
12
votes
8 answers

Current Standard C Compiler?

I wanted to know what is the current standard C compiler being used by companies. I know of the following compilers and don't understand which one to use for learning purposes. Turbo C Borland C GCC DJGPP I am learning C right now and…
name_masked
  • 9,544
  • 41
  • 118
  • 172
10
votes
3 answers

In C, how do I write to a particular memory location e.g. video memory b800, in DOS (real DOS, MS DOS 6.22)

In C, how do I write to a particular memory location e.g. video memory b800, in DOS (real DOS, MS DOS 6.22) I understand that C doesn't have anything built in to do that, but that there may be some platform specific e.g. DOS specific API functions…
barlop
  • 12,887
  • 8
  • 80
  • 109
10
votes
4 answers

How does C++ store functions and objects in memory?

Lets say we have a class class A { int x; public: void sayHi() { cout<<"Hi"; } }; int main() { A *a=NULL; a->sayHi(); } The above code will compile on Turbo C (where I tested) and print Hi as output. I was expecting…
user1709663
  • 101
  • 1
  • 3
8
votes
6 answers

BGI error, How to Resolve it?

I want to run a C program that draws a circle. The program is compiling with no error and it is running. After getting the values like radius from the user, I get the error like this : BGI error: Graphics not initialized ( use "initgraph") Even…
sriram
  • 8,562
  • 19
  • 63
  • 82
8
votes
3 answers

Arrays of pointers that point to arrays of integers

I am just wondering if there is a way to make an array of pointers that point to the first column of each row in a multidimensional array of integers. As an example, please look at the following code: #include int day_of_year(int year,…
W. Zhu
  • 755
  • 6
  • 16
7
votes
2 answers

Using a Visual C++ DLL in old Borland C?

I've got to support an old app written in C using the old Borland Compiler (BC 5). Unfortunately the old TCP/IP library that we'd used is starting to show it's age and is having problems with Vista & Win7 machines. I have a new library of functions…
Steve76063
  • 317
  • 2
  • 10
7
votes
11 answers

How to fix "unable to open stdio.h in Turbo C" error?

Whenever I compile my program, I get the error above.
aditya
  • 71
  • 1
  • 1
  • 2
7
votes
5 answers

Turbo C++: Why does printf print expected values, when no variables are passed to it?

A question was asked in a multiple choice test: What will be the output of the following program: #include int main(void) { int a = 10, b = 5, c = 2; printf("%d %d %d\n"); return 0; } and the choices were various…
SgrA
  • 289
  • 3
  • 9
6
votes
2 answers

Suppressing "Insert diskette to drive X:"

I am trying to check does any disk is present in drive A: (after my program installs i need to ensure that computer won't boot from installation diskette). I've tried using _access method (undefined reference...), FILE* and making directory inside…
Kamila Szewczyk
  • 1,874
  • 1
  • 16
  • 33
6
votes
5 answers

Errors using ternary operator in c

I have a piece of code in C given as follows : main() { int a=10, b; a>=5 ? b=100 : b=200 ; printf("%d" , b); } running the code on gcc compiler in unix generates the compile-time error as 'lvalue required as left operand of…
6
votes
1 answer

Keyboard interrupt handle in c global variable usage

I have a project like space impact and I try to handle keyboard interrupt.My problem is I don't want to use global variable(ship) in my_keyboard_interrupt_handler .But i send ship as paremeter to this function , i don't know how to arrange…
Melih Altıntaş
  • 2,495
  • 1
  • 22
  • 35
1
2 3
18 19