如果声明了union,则不会显示循环

时间:2017-07-21 15:30:08

标签: c for-loop unions

如果我包含$String = " This phrase starts at index 4 ends at some point`r`nand then there's more" # Define the start index $Offset = 4 # Find the index of the end marker $CRLFIndex = $string.IndexOf("`r`n") # Check that the end marker was actually found if($CRLFIndex -eq -1){ throw "CRLF not found in string" } # Calculate length based on end marker index - start index $Length = $CRLFIndex - $Offset # Generate substring $Substring = $String.Substring($Offset,$Length) 的声明,为什么下面代码中的for循环似乎无法运行?我正在使用clang编译器。

union test

1 个答案:

答案 0 :(得分:3)

这是未定义的行为。你从未初始化i