Process finished with exit code -1073741819 (0xC0000005)
程序员文章站
2024-02-12 13:27:46
...
遇到该问题的会有各种情况,我的是以下情况遇到的,
在python调用c++ 的dll的时候,传递参数是char*时候,在c++中,参数out这么赋值 python调该函数 可以得到out为123
EXTERNC ISAC_API void test222( char* &out) {
printf("%d %s\r\n", 1,out);
out="123";
}
但是c++中如果这样给out赋值
EXTERNC ISAC_API void test222( char* &out) {
printf("%d %s\r\n", 1,out);
string s = "hello java";
strcpy_s(out, STR_LEN, s.c_str());
}
把一个string strcpy_s()函数通过转换成char* python调用的时候,值也可以得到,但是程序会崩溃。知道问题出在这里但是不知道怎么解决。
发现用strcpy()来转换string类型时候,编译不通过,需要在在文件开头加上这句话,编译通过了而且python调用也不报错了
#pragma warning(disable:4996)
推荐阅读
-
Process finished with exit code -1073741819 (0xC0000005)
-
启动就结束 报错:Process finished with exit code 0
-
Process finished with exit code -1073740791 (0xC0000409)
-
Process finished with exit code 0
-
Process finished with exit code 0
-
SpringBoot Process finished with exit code 0
-
SpringBoot: Process finished with exit code 0
-
Process finished with exit code -1073741571 (0xC00000FD)的解决方案
-
SpringBoot - Process finished with exit code 0
-
Tensorflow中Process finished with exit code -1073741819 (0xC0000005)的一种解决方案