如何从命令行构建 Borland C++ 项目文件 (bpr) 和包文件 (bpk)?项目组(bpg)显然是 make 文件,可以使用 make 进行编译。但 bpks 和 bprs 是基于 xml 的,导出到 Makefile 无法使用 make 进行编译。如果我将项目放入 bpg 中,make 似乎无法找到 bpg 中指定的任何文件,因为它们似乎都是相对引用。我更改了对绝对值的引用并生成报告: Fatal: Unable to open makefile
我正在尝试创建一个函数来获取向量中的3个最大数字.例如:数字:1 6 2 5 3 7 4结果:5 6 7
我想我可以对它们进行DESC排序,在开始时获取3个数字,然后使用ASC,但这会浪费内存分配和执行时间.我知道有一个更简单的解决方案,但我无法弄清楚.另一个问题是,如果我只有两个数字怎么办...
BTW:我用作编译器BorlandC++ 3.1(我知道,很老了,但这就是我在考试中使用的...)
多谢你们.
LE:如果有人想了解我正在努力完成的事情,你可以查看代码:
#include<fstream.h>
#include<conio.h>
int v[1000], n;
ifstream f("bac.in");
void citire();
void afisare_a();
int ultima_cifra(int nr);
void sortare(int asc);
void main() {
clrscr();
citire();
sortare(2);
afisare_a();
getch();
}
void citire() {
f>>n;
for(int i = 0; i < n; i++)
f>>v[i];
f.close();
}
void afisare_a() {
for(int i = 0;i < n; i++)
if(ultima_cifra(v[i]) == 5)
cout<<v[i]<<" ";
}
int ultima_cifra(int nr) {
return nr - 10 * …Run Code Online (Sandbox Code Playgroud) 我有一个C++ Builder应用程序,我需要在其中使鼠标光标不可见.我怎样才能做到这一点?
我认为可以使用Win32 API完成,但我不知道具体如何.
我的核心项目是标准的Windows应用程序,正在C++ Builder XE下开发.这个项目使用的是在旧版开发环境中编写的dll文件,即C++ Builder 6.应用程序在dll中的某个地方崩溃所以我决定调试dll.我应该设置什么才能看到dll的源代码?我只能看到汇编代码.好像调试器看不到源代码目录.我已将调试符号文件*.tds复制到与*.dll相同的目录中,似乎它什么都没有.
我在DBGrid外面有DBGrid和按钮"删除".我怎么判断,用户在DBGrid中选择了一些字符串?因为如果表单打开并且在DBGrid中没有选择任何字符串,并且用户单击了"删除"按钮 - 我需要向他显示警告框"未选择任何字符串!选择要删除的字符串".
在Delphi中,我写了以下代码来识别一个Graphic是一个TBitmap:
if aImage.Picture.Graphic is TBitmap then
...
Run Code Online (Sandbox Code Playgroud)
在 C++ Builder 中,我编写了以下代码:
if (dynamic_cast<Image1->Picture->Graphic>(TBitmap) != 0)
....
Run Code Online (Sandbox Code Playgroud)
但它不起作用。C++ Builder 如何在 Delphi 中做同样的检查?
我正在使用C++ Builder XE4和Windows 32位VCL平台.
我正在设置.INI文件,其中包括使用句点(.)作为小数分隔符的浮点数.在欧洲,他们使用逗号(,)作为小数分隔符.
我正在使用TIniFileC++ Builder内置的类.
会TIniFile在欧洲阅读下面的文件条目吗?我需要.INI使用逗号作为分隔符的第二个文件吗?
当我读取浮点值时,我的故障安全返回值也使用句点(.).在下面的代码中,
ReadFloat("Forex", "Size", 0.01 );
Run Code Online (Sandbox Code Playgroud)
0.01是故障安全返回值.
这会在欧洲发挥作用吗?
例如:
MyList.ini:
[Forex]
Size=0.0001
Value=10.5
OffSet=0.01
//Read TIniFile
MyList = new TIniFile("C:\\MyList.ini");
double r_Size = MyList->ReadFloat("Forex", "Size", 0.01);
double r_Value = MyList->ReadFloat("Forex", "Value", 10.0);
double r_OffSet = MyList->ReadFloat("Forex", "OffSet", 0.01);
Run Code Online (Sandbox Code Playgroud)
编辑在下面
您在答案中指出TIniFile是否在正确读取的相同位置写入和读取.是否可以打开并重新保存我的.INI文件一次以将它们转换为本地格式?然后,我可以使用我当前的代码,没有任何变化.我将在循环中为我的.INI文件中的每个浮点执行以下三个步骤.这会重新格式化.INI文件吗?
我只需要调整故障安全返回值以使用本地分隔符.
步骤1)检查分隔符的本地值
步骤2)使用美国格式加载浮点数(.)分隔符
步骤3)使用本地分隔符重新保存
void __fastcall ConvertToLocalSeparator( ){
//1 Check Local Value of Seperator
TFormatSettings fmt = TFormatSettings::Create();
UnicodeString …Run Code Online (Sandbox Code Playgroud) 我正在使用 C++Builder 10.3 Rio 和 VCL Windows 应用程序。我正在使用 TScreen->Forms 来获取有关我的程序打开表单的信息。这显示 FormCount 比我预期的要高。我的应用程序有两个打开的窗体(1)主程序窗体和(2)数据输入对话框。当我检查 Screen->FormCount 时,它显示 6 个表单。当我检查下面的 for 循环中的表单名称和标题时,只有我的 2 个表单有名称和标题。其他表单名称和标题均为 NULL。我可以使用dynamic_cast或表单名称来识别我的表单。还有哪些额外的形式?我如何识别其他表格?
UnicodeString MyName, MyCaption;
for(int j=0; j<Screen->FormCount; j++){
MyName = Screen->Forms[j]->Name;
MyCaption = Screen->Forms[j]->Caption;
TMyForm *MyLocal = dynamic_cast<TMyForm *>( Screen->Forms[j] );
}
for(int j=0; j<Screen->CustomFormCount; j++){
MyName = Screen->CustomForms[j]->Name;
MyCaption = Screen->CustomForms[j]->Caption;
}
Run Code Online (Sandbox Code Playgroud) 如果我有一个类定义为:
// foo.h
class Foo
{
public:
virtual void GetFoo();
}
Run Code Online (Sandbox Code Playgroud)
我想要一个TForm继承它,例如
class TFMainWindow : public TForm, public Foo
{
...
}
Run Code Online (Sandbox Code Playgroud)
我收到错误
[bcc32c 错误] TFMainWindow.h(36):Delphi 样式类必须从 Delphi 样式类派生
我该如何解决这个问题?
我为大学任务编写了一个C++程序.我在我的Mac上运行了Netbeans 6.8,代码运行顺畅,没有警告,错误或问题/错误.但是,当使用CodeGear RAD Studio 2009(C++ Builder)在Windows计算机上进行编译和运行时,会出现几个错误.
[BCC32 Error] main.cpp(51): E2094 'operator<<' not implemented in type 'ostream' for arguments of type 'string'
[BCC32 Error] main.cpp(62): E2093 'operator==' not implemented in type 'string' for arguments of the same type
[BCC32 Error] main.cpp(67): E2093 'operator==' not implemented in type 'string' for arguments of the same type
[BCC32 Error] main.cpp(112): E2093 'operator==' not implemented in type 'string' for arguments of the same type
[BCC32 Error] main.cpp(121): E2094 'operator<<' not implemented in type 'ostream' for …Run Code Online (Sandbox Code Playgroud) c++builder ×10
delphi ×5
c++ ×4
command-line ×1
debugging ×1
dll ×1
ini ×1
vector ×1
winapi ×1