本文介绍了无法读取内存错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好

我试图在vs 2013中的控制台应用程序中运行此代码,但是当我运行代码时出现以下错误:

-argv [1] 0x00000000 <空> char *



<无法=读=记忆=>



这是主函数代码:

int main(int argc,char ** argv)

{

set_new_handler(memory_err);

// cout<< 你好......<< argv [0]<< '\ n';;



if(strcmp(argv [1],lit)== 0){

/ /规则

TransPar par;



get_args(par,argc,argv); //得到论点

gen_rules(par); //生成规则(真的,只是交易)

}



else if(strcmp(argv [1],seq)= = 0){

//对于序列

SeqPar par;



get_args(par,argc,argv ); //得到论点

gen_seq(par); //生成序列

}



else if(strcmp(argv [1],tax)== 0){

//对于具有分类法的规则

TaxPar par;



get_args(par,argc,argv); //得到论点

gen_taxrules(par); //生成规则(真的,只是交易)

}



else if(strcmp(argv [1], - version) == 0){

print_version();

返回0;

}



else {

cerr<< 合成数据生成,

print_version();

cerr<< 用法:<< argv [0]<< lit | tax | seq [options] \ n;

cerr<< << argv [0]

<< lit | tax | seq -help更详细的选项列表\ n;

返回1;

}



返回0;

}



另外我应该提到源代码是为Unix构建的,但我修改了它以便运行获胜。

感谢先进的任何帮助或建议;)

Hi there
I am trying to run this code in console app in vs 2013 but when I run the code give following error:
-argv[1]0x00000000 <null>char *

<unable to="" read="" memory="">

this is the main function code:
int main(int argc, char **argv)
{
set_new_handler(memory_err);
// cout << "Hello there..." << argv[ 0 ] << '\n';;

if (strcmp(argv[1], "lit") == 0) {
// For Rules
TransPar par;

get_args(par, argc, argv); // get arguments
gen_rules(par); // generate rules (really, just transactions)
}

else if (strcmp(argv[1], "seq") == 0) {
// For Sequences
SeqPar par;

get_args(par, argc, argv); // get arguments
gen_seq(par); // generate sequences
}

else if (strcmp(argv[1], "tax") == 0) {
// For Rules with Taxonomies
TaxPar par;

get_args(par, argc, argv); // get arguments
gen_taxrules(par); // generate rules (really, just transactions)
}

else if (strcmp(argv[1], "-version") == 0) {
print_version();
return 0;
}

else {
cerr << "Synthetic Data Generation, ";
print_version();
cerr << "Usage: " << argv[0] << " lit|tax|seq [options]\n";
cerr << " " << argv[0]
<< " lit|tax|seq -help For more detailed list of options\n";
return 1;
}

return 0;
}

Also I should mentioned the source code was built for Unix but I modified it for runing to win.
Thanks in advanced for any help or suggestion ;)

推荐答案



这篇关于无法读取内存错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-18 15:28