小编For*_*van的帖子

抽象函数和变量参数列表

我有一个抽象类,我想知道是否可以使用变量参数列表定义一个抽象函数?

如果可能的话给我一个例子.

c++ function variadic-functions abstract

6
推荐指数
1
解决办法
3517
查看次数

在MFC中使用静态库

我尝试在我的MFC项目中使用静态库,但是我收到以下链接器错误:

1>------ Build started: Project: Csetkliens, Configuration: Debug Win32 ------
1>Build started 2012.05.20. 16:12:49.
1>InitializeBuildStatus:
1>  Touching "Debug\Csetkliens.unsuccessfulbuild".
1>ClCompile:
1>  All outputs are up-to-date.
1>  All outputs are up-to-date.
1>ResourceCompile:
1>  All outputs are up-to-date.
1>ManifestResourceCompile:
1>  All outputs are up-to-date.
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: __thiscall std::_Lockit::~_Lockit(void)" (??1_Lockit@std@@QAE@XZ) already defined in libcpmtd.lib(xlock.obj)
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "public: __thiscall std::_Lockit::_Lockit(int)" (??0_Lockit@std@@QAE@H@Z) already defined in libcpmtd.lib(xlock.obj)
1>msvcprtd.lib(MSVCP100D.dll) : error LNK2005: "void __cdecl std::_Debug_message(wchar_t const *,wchar_t const *,unsigned int)" (?_Debug_message@std@@YAXPB_W0I@Z) already defined …
Run Code Online (Sandbox Code Playgroud)

c++ compiler-construction linker mfc static-libraries

6
推荐指数
1
解决办法
9880
查看次数

引用ArrayList的元素

我尝试获取对ArrayList元素的引用,但是我失败了.

ArrayList<String> test = new ArrayList<String>();

test.add("zero");
test.add("one");
test.add("two");

 String s1 = test.get(1);
 String s2 = test.get(1);

 System.out.println(test.get(1) +" " + s1 + " " + s2);

 s1 += " modificated";

 System.out.println(test.get(1) +" " + s1 + " " + s2);
Run Code Online (Sandbox Code Playgroud)

有什么建议?

java arraylist

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