小编Bab*_*boB的帖子

投入"对象"类型的目的是什么?

我在网站上找到了如下代码.

 string a = "xx";
 string b = "xx";
 string c = "x";
 string d = String.Intern(c + c);

 Console.WriteLine((object)a == (object)b); // True
 Console.WriteLine((object)a == (object)d); // True
Run Code Online (Sandbox Code Playgroud)

在这里,再次投射到对象类型的目的是什么,因为a,b,d本身就是字符串的对象?

.net c# string equality string-interning

19
推荐指数
3
解决办法
734
查看次数

C程序仅在GCC中执行后终止

我有意在我的程序中进行了一个超出范围的索引访问,如下所示:

#include<stdio.h>

int main()
{
    int x[1];

    x[1] = 3; // expected SIGABRT here
    printf("x[1] = %d\n",x[1]);

    return 0;
}
Run Code Online (Sandbox Code Playgroud)

但是我的程序只在执行了我期待中止的行之后才被终止.调试时发生了同样的情况.找到下面的输出.

x[1] = 3
*** stack smashing detected ***: <unknown> terminated
Aborted (core dumped)
Run Code Online (Sandbox Code Playgroud)

我知道C没有超出检查功能.我的问题是为什么它没有在执行x [1] = 3而没有进入下一个语句时终止?

c compiler-construction gcc

2
推荐指数
1
解决办法
82
查看次数

如何在oracle里面的where子句中使用case语句?

我得到PL/SQL:ORA-00905:运行以下脚本时缺少关键字错误

create or replace procedure testing
(ass_line in char,
 curs out sys_refcursor
)
is
begin
open curs for 
select asl.Production_Group,asl.last_sequence_nbr
from ASSEMBLY_LINE asl
where(case 
   when ass_line='551F'
     then asl.assembly_line in('551F','551C','551S')
   else
     asl.assembly_line=ass_line
   end);
end;
Run Code Online (Sandbox Code Playgroud)

请帮帮我

oracle plsql case

0
推荐指数
1
解决办法
2382
查看次数

标签 统计

.net ×1

c ×1

c# ×1

case ×1

compiler-construction ×1

equality ×1

gcc ×1

oracle ×1

plsql ×1

string ×1

string-interning ×1