字符串::格式有什么用. 我也没有在互联网上得到它
what is the use of string::format. i am no getting it on internet as well
void updateList(void) {
numCam = get_noofcameras_connected();
if (numCam != 0) {
CameraSelect->Text = ("Please select Camera");
CameraSelect->Items->Add("ALL");
for (int i = 1; i < numCam + 1; i++) {
CameraSelect->Items->Add(string::format("Camera {0}", i));
}
}
else {
CameraSelect->Text = ("NO CAMERA CONNECTED");
}
}
它给出的错误字符串是不明确的.
对于C#,你可以调用.Format
这里有一个例子来自
.doc
Decimal pricePerOunce = 17.36m;
String s = String.Format("The current price is {0} per ounce.",
pricePerOunce);
Console.WriteLine(s);
相关文章:
- 为不同配置设置MSVC_RUNTIME_LIBRARY的正确方法是什么
- 警告处理为错误这里有什么问题
- 什么时候调用组成单元对象的析构函数
- #定义c-预处理器常量..我做错了什么
- 努力将整数转换为链表。不知道我在这里做错了什么
- C++我的数学有什么问题,为什么我的代码不能正确循环
- 什么时候在C++中返回常量引用是个好主意
- 当在同一名称空间中有两个具有相同签名的函数时,会发生什么
- C++避免重复声明的语法是什么
- c++库的公共头文件中应该包含什么
- 问题:什么是QAbstractItemView::NoEditTriggers的反面
- 有什么方法可以遍历结构吗
- 当类在C++中定义时,有什么方法可以"register"类吗?
- ifstream什么都没读
- 在C++中,将大的无符号浮点数四舍五入为整数的最佳方法是什么
- 实现无开销push_back的最佳方法是什么
- C++从另一个类访问公共静态向量的正确方法是什么
- "throw expression code" 1e7 >返回 d 是什么?投掷标准::overflow_error( "too big" ) : d;意味 着?
- 使用C或C++检查互联网连接的最快方法是什么
- 创建读取面向互联网的套接字的守护进程有什么安全问题?