首页 \ 问答 \ 在VC ++ 6中,“for循环”的终止条件是否刷新?(Does the termination condition of a 'for loop' refresh in VC++ 6?)

在VC ++ 6中,“for循环”的终止条件是否刷新?(Does the termination condition of a 'for loop' refresh in VC++ 6?)

for (int i = 0 ; i < stlVector.size() ; i++)
{ 
    if (i == 10)
    { 
        stlVector.erase(stlVector.begin() + 5 )
    }
}

终止条件部分“stlVector.size()”是否考虑了“stlVector.erase(...)”? 换句话说,每次循环迭代都会刷新stlVector.size()吗? 我现在无法测试,所以我在这里发了一个问题。

Thx提前!

最好的祝福,

zhengtonic


for (int i = 0 ; i < stlVector.size() ; i++)
{ 
    if (i == 10)
    { 
        stlVector.erase(stlVector.begin() + 5 )
    }
}

Does the termination condition part "stlVector.size()" take "stlVector.erase(...)" into consideration? In other word does stlVector.size() refresh for every loop iteration? I can't test it right now, so i posted a question here.

Thx in advance!

Best regards,

zhengtonic


原文:https://stackoverflow.com/questions/542028
更新时间:2022-11-17 10:11

最满意答案

所以我找到了答案,我无法相信我错过了这个非常简单的事情。 希望这将有助于其他任何有此问题的人。

在链接器部分,确保它是“Other Linker Flags” -ObjC -all_load

我错误地输入-ObjC - all_load第二次冲刺后的空间是原因。


So I found the answer, I can't believe I missed this very simple thing. Hopefully this will help anyone else who has this issue.

In the Linker section ensure that it is "Other Linker Flags" -ObjC -all_load

I mistakenly entered -ObjC - all_load The space after the second dash was the cause.

相关问答

更多
  • 默认情况下,RestKit配置为使用JSONKit 您的导入错误,这不会导入您想要的内容。 尝试这个,但这是Wile E. Coyote的解决方案 #import "RestKit/Code/Support/Parsers/JSON/RKJSONParserJSONKit.h" 3.如果您确实要复制资源,请仅复制头文件,而不是源(.m) RestKit is configured by default to use JSONKit Your import is wrong, this doesn't ...
  • 找到此链接: https : //stackoverflow.com/a/5095793/1082660 并将我的链接器标志更新为:-force_load $(BUILT_PRODUCTS_DIR)/libRestKit.a 一切似乎都在起作用。 注意,我也仔细检查了我的进口。 我最初在下面注释了注释掉的行,但是将它们更改为未注释的行。 这可能是一个令人困惑的因素。 //#import "AWSiOSSDKv2/AWSCore.h" //#import "AWSiOSSDKv2/AWSS3.h" #impo ...
  • 删除all_load和-ObjC标志。 而是添加force_load $(BUILT_PRODUCTS_DIR)/libRestKit.a 它应该工作。 Remove all_load and -ObjC flags. Instead, add force_load $(BUILT_PRODUCTS_DIR)/libRestKit.a It should work.
  • 您似乎在响应描述符中使用notecardMapping而不是errorMapping 。 尝试这个: RKObjectMapping *errorMapping = [RKObjectMapping mappingForClass:[RKErrorMessage class]]; [errorMapping addPropertyMapping:[RKAttributeMapping attributeMappingFromKeyPath:nil toKeyPath:@"errorMessage"]]; ...
  • 所以我找到了答案,我无法相信我错过了这个非常简单的事情。 希望这将有助于其他任何有此问题的人。 在链接器部分,确保它是“Other Linker Flags” -ObjC -all_load 我错误地输入-ObjC - all_load第二次冲刺后的空间是原因。 So I found the answer, I can't believe I missed this very simple thing. Hopefully this will help anyone else who has this is ...
  • Zebra API通过IPC Linea Sled设备链接到另一个用于蓝牙通信的API。 LineaBtPrinterConnection链接到该库文件( libdtdev.a )。 通常情况下,如果您不关心通过雪橇的BT通信,则不必链接该库,但由于您正在添加-ObjC标志,因此它正在加载该文件并查找该库。 如果将libdtdev.a库添加到项目中,则该错误应该消失。 该库应该包含在Zebra的“Demos”项目文件夹下的下载中。 如果您需要实际使用底座,根据底座的固件版本,您可能需要IPC的新版本,如果您 ...
  • 如果您正在为iPhone构建,请确保您没有将RestKit.framework添加到目标中; 在'Link Binary With Libraries'中。 HTH if you're building for the iPhone, just make sure you don't have the RestKit.framework added to your target; in the 'Link Binary With Libraries'. HTH
  • 你缺少添加libflex或者它可能是libfl。 你的主要错误ld: library not found for -lfl库告诉你库丢失了。 l in -lfl表示库。 通过添加库,您将看不到此错误 you are missing to add libflex or it could be libfl. your main error ld: library not found for -lfltells that library is missing. l in -lfl denotes the libr ...
  • 如果您使用的是最新版本的Watson Swift SDK,它不再将RestKit构建为单独的框架,而是将其直接链接到每个服务。 所以你应该能够从项目中删除RestKit框架。 在您的特定情况下,您需要在Xcode中选择Home Assistant项目,然后选择Home Assistant目标。 在Build Phases中,打开“Link Binary with Libraries”项并删除RestKit.framework。 然后在“运行脚本”阶段,从输入文件列表中删除RestKit.framework。 ...
  • 尝试使用Cocoapods安装方法......不应该以这种方式获取那些链接器错误。 Try the Cocoapods installation method... shouldn't get those linker errors that way.

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)