我发现此代码仅用于gotoxy()使用C标准库的替换函数.显然它编译使用GCC和工作方式类似于gotoxy()中发现的conio.h.
但是我只有用Borland C++编译器V5.5,该编译罚款,但不会重新像光标gotoxy()在conio.h做.任何人都可以在使用GCC时验证这是否有效,或者告诉我为什么使用Borland不起作用?
#include<stdio.h>
#include<stdlib.h>
void gotoxy(int x, int y)
{
printf("%c[%d;%df", 0x1B, y, x);
}
int main()
{
gotoxy(10, 10);
printf("hello world");
}
Run Code Online (Sandbox Code Playgroud) 我使用 freecommandlinetools 编译器 bcc32。我需要在我的程序中使用第三方 dll。我不想调用LoadLibraryand GetProcAddress,而是在我的程序中链接 dll 以直接调用 dll 函数。
#include "somelibrary.h"
int main() {
somefunction(); // defined in somelibrary.dll
}
Run Code Online (Sandbox Code Playgroud)
我在尝试编译时看到未解析的外部对象。如何说服链接器与 somelibrary.dll 链接?
如何在Borland C++中使用NaN初始化数字?
复制:在C++中使用NaN?
[我可能错了] TIdTCPServer Server在Borland C++构建器中是多线程的.它在单独的线程上处理所有客户端.这是在Borland c ++的帮助下编写的.
现在是我的问题和疑问.例如,ShowMessage(String ..)应该在main(gui)线程上调用方法.但正如我上面所说,TCPServer是多线程的,并处理OnExecute不同线程上的事件.当我在OnExecute事件中使用ShowMessage方法(在与主线程不同的线程上处理)时,我得到了奇怪的结果.有时ShowMessage()按预期工作,有时它显示没有任何文字与不同的盒子大小(无限长,非常长,正常等).其他用户界面更改没有问题(更新TEdit,TMemo.ShowMessage()现在只有问题)
我认为这个问题是调用ShowMessage()方法不是在主(gui)线程上而是在TCPServer的线程上的结果,该线程是由TIdTCPServer在内部为客户端连接创建的.那么我该如何解决呢?
使用dll需要注册dll吗?我听说16位dll不需要注册,那么32位dll呢?我将使用borland c++ 4.52开发的16位dll转换为使用borland c++ 5.02开发的32位dll。我的问题是我是否需要注册?当我尝试使用 regsvr32 注册时,出现错误“模块已加载,但未找到入口点 DllRegistryServer。请确保它是有效的 Dll 或 OCX,然后重试”。
提前致谢...
我正在尝试将项目从迁移Borland C++到Visual C++
我注意到如本例所述在处理枚举方面存在差异
档案:Test_enum.cpp
#ifdef _MSC_VER
#include <iostream>
#else
#include <iostream.h>
#endif
#include <conio.h>
using namespace std;
enum {
ENUM_0 =0,
ENUM_1,
ENUM_2,
ENUM_3
} ;
int main(int argc, char* argv[])
{
#ifdef _MSC_VER
cout << "Microsoft Visual compiler detected!" << endl;
#elif defined(__BORLANDC__)
cout << "Borland compiler detected!" << endl;
#elif
cout << "Other compiler detected!" << endl;
#endif
#if ENUM_1 > 0
cout << "ENUM_1 is well defined at preprocessing time" << endl;
#else …Run Code Online (Sandbox Code Playgroud) 我想使用大数字是我的数据,所以我尝试了这个.
#include<iostream.h>
#include<conio.h>
struct DataType{
unsigned long long int i,j;
}a;
int main(){
a.i=1;a.j=1;
while(a.j>0){
a.i=a.j;
a.j++;
}
cout << a.i;
return 0;
}
Run Code Online (Sandbox Code Playgroud)
注意:编译器:Borland 5.02
我正在尝试在TurboC++ 3.0中编译此代码.但是,我收到了这些错误:
DOS.H 77: Too many types in declaration
DOS.H 77: { expected
DOS.H 77: Declaration does not specify a tag or an identifier
SARSAL.CPP 72: Cannot cast from 'int' to 'time'
Run Code Online (Sandbox Code Playgroud)
我检查了库的目录,我在BorlandC++ 5.02中运行了代码(不幸的是,我得到了图形错误或错误:Constructor cannot have a return type specification在方法中void Agente::Agente),DevC++和Code :: Blocks没有成功.
代码由我们的AI老师提供,据说工作正常.如何编译?
谢谢您的帮助.
完整的代码是正确的,但我在第28行只得到了这一个错误:declaration terminated incorrectly.
#include<fstream.h>
#include<stdio.h>
#include<conio.h>
#include<process.h>
#include<string.h>
#include<iostream.h>
class Rail
{
private:
char GetYN();
struct Train
{
int tno, nop;
char tname[50];
char dest[50];
float dist, fare;
}t;
public:
void Input();
void CreateFile();
void Display();
void Search();
void Modify();
void Delete();
void AddRecord();
}R;
void introduction();
{ \\This is where the error is (error: declaration terminated incorrectly)
clrscr()
cout << "\n\n";
cout << "\t =============================================================\n";
cout << "\t ** **\n";
cout << "\t ** WELCOME TO **\n"; …Run Code Online (Sandbox Code Playgroud) borland-c++ ×9
c++ ×6
c ×2
c++builder ×2
dll ×2
c99 ×1
enums ×1
gcc ×1
indy ×1
nan ×1
numbers ×1
turbo-c++ ×1
visual-c++ ×1