turbo-c++

Borland x86 inlined assembler; get a label's address?

ぃ、小莉子 提交于 2019-11-30 03:31:13
问题 I am using Borland Turbo C++ with some inlined assembler code, so presumably Turbo Assembler (TASM) style assembly code. I wish to do the following: void foo::bar( void ) { __asm { mov eax, SomeLabel // ... } // ... SomeLabel: // ... } So the address of SomeLabel is placed into EAX. This doesn't work and the compiler complains of: Undefined symbol 'SomeLabel'. In Microsoft Assembler (MASM) the dollar symbol ($) serves as the current location counter, which would be useful for my purpose. But

Must the int main() function return a value in all compilers? [duplicate]

左心房为你撑大大i 提交于 2019-11-27 20:34:22
This question already has an answer here: What should main() return in C and C++? 17 answers Why is it not necessary to include the return statement while using int main() in some compilers for C++? What about Turbo C++? In C++, and in C99 and C11, it is a special rule of the language that if the control flow reaches the end of the main function, then the function impliclty returns 0 . In C++ and C99/C11, without a return statement in main function, it's default to return 0 ; § 3.6.1 Main function A return statement in main has the effect of leaving the main function (destroying any objects

Mouse program in Turbo CPP

こ雲淡風輕ζ 提交于 2019-11-27 05:33:42
I have written a program in turbo cpp, which uses mouse for a basic GUI. I have also written a function that determines if the mouse has been clicked on a certain text displayed at a certain position. Everything works fine on the first run. But when i run the program, a second time a problem arises. Even when the mouse is just passed over an option(not clicking) it gets selected and the next page is displayed. Thanks again for those who answers. I am also attaching the code for mouse functions.. union REGS in,out; int callmouse() { in.x.ax=1; int86(51,&in,&out); return 1; } void mouseposi(int

Must the int main() function return a value in all compilers? [duplicate]

大兔子大兔子 提交于 2019-11-26 18:18:24
问题 This question already has answers here : What should main() return in C and C++? (17 answers) Closed 6 years ago . Why is it not necessary to include the return statement while using int main() in some compilers for C++? What about Turbo C++? 回答1: In C++, and in C99 and C11, it is a special rule of the language that if the control flow reaches the end of the main function, then the function impliclty returns 0 . 回答2: In C++ and C99/C11, without a return statement in main function, it's

Why doesn't a simple “Hello World”-style program compile with Turbo C++?

馋奶兔 提交于 2019-11-25 23:49:44
问题 I have started learning C++ for my programming class. I have downloaded this \"Hello World\" program: #include <iostream> using namespace std; int main() { cout << \"Hello, World!\"; return 0; } but Turbo C++ complains: Error D:\\HELLO.CPP 1: Unable to open include file \'IOSTREAM\' Error D:\\HELLO.CPP 2: Declaration syntax error Error D:\\HELLO.CPP 6: Undefined symbol \'cout\' What\'s wrong with this very simple program? How can I correct these errors? 回答1: There's no problem with this

Why should I not #include <bits/stdc++.h>?

帅比萌擦擦* 提交于 2019-11-25 22:51:45
问题 I posted a question with my code whose only #include directive was the following: #include <bits/stdc++.h> My teacher told me to do this, but in the comments section I was informed that I shouldn\'t. Why? 回答1: Including <bits/stdc++.h> appears to be an increasingly common thing to see on Stack Overflow, perhaps something newly added to a national curriculum in the current academic year. I imagine the advantages are vaguely given thus: You only need write one #include line You do not need to

Why doesn&#39;t a simple “Hello World”-style program compile with Turbo C++?

我怕爱的太早我们不能终老 提交于 2019-11-25 22:07:59
I have started learning C++ for my programming class. I have downloaded this "Hello World" program: #include <iostream> using namespace std; int main() { cout << "Hello, World!"; return 0; } but Turbo C++ complains: Error D:\HELLO.CPP 1: Unable to open include file 'IOSTREAM' Error D:\HELLO.CPP 2: Declaration syntax error Error D:\HELLO.CPP 6: Undefined symbol 'cout' What's wrong with this very simple program? How can I correct these errors? n.m. There's no problem with this program. (Except probably some stylistic issues — using namespace std is not recommended). The problem is with Turbo C++