由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - C & C++ mixing question
相关主题
What does the default constructor do?问个c++的template的问题
菜鸟读C++ STL源程序的疑问定义 单链表 数组,会不会很奇怪
用STL map的时候怎么自己定义大小比较的关系Three C/C++ Programming Questions
STL 一问[转载] 问一个C++下计时的问题
[合集] 大家看看我这个C++ STL Functor那里写错了请教一个MS Linked List的问题
一个C++ template的问题问个 C++到C的问题
c++ question问个剧简单的问题...
access function static variableone question about struct
相关话题的讨论汇总
话题: c++话题: stl话题: question话题: structs话题: call
进入Programming版参与讨论
1 (共1页)
w******g
发帖数: 67
1
"Question about C functions calling C++ STL - can we C structs typecasted
into C++ containers (asked some specifics here)"
Call C functions call STL function?
Actually, this is from someone's interviewing one headhunter sent to you.
So it maybe just part of original question. Any idea, reference or
discussion is welcome.
Thanks a lot.
E*V
发帖数: 17544
2
are you asking " can C call c++ stl functions?"
if so, yes

【在 w******g 的大作中提到】
: "Question about C functions calling C++ STL - can we C structs typecasted
: into C++ containers (asked some specifics here)"
: Call C functions call STL function?
: Actually, this is from someone's interviewing one headhunter sent to you.
: So it maybe just part of original question. Any idea, reference or
: discussion is welcome.
: Thanks a lot.

w******g
发帖数: 67
3
Could you give more details, examples or any references?Cannot find good
posts on Google. Thanks.
w******g
发帖数: 67
4
我觉得题目的意思可能是:
1. C 程序能不能调用 STL 库函数
2. 如果可以, 能不能把C程序中定义的struct 作为变量传给 STL 函数。
比如,我在C程序中定义了一个struct list(或者是array of struct), 能不能调用STL
中的标准函数(像:sort,find),把C程序中的list(或者是array of struct)作为
参数传给sort 或者 find?或者在什么情况下可以传递呢?
如果理解的不对,请指教。
k*******d
发帖数: 1340
5
Even if you are using C compiler???

【在 E*V 的大作中提到】
: are you asking " can C call c++ stl functions?"
: if so, yes

d****p
发帖数: 685
6
1. Calling STL stuff from C code
Yes you can if the C code will be compiled in C++.
2. Probably not since normally real C structs are not copible/assignable in
C++ perspective (no copy ctor/assignment operator) and hence don't fit STL
container requirement. If these structs are POD then that's another story.

【在 w******g 的大作中提到】
: "Question about C functions calling C++ STL - can we C structs typecasted
: into C++ containers (asked some specifics here)"
: Call C functions call STL function?
: Actually, this is from someone's interviewing one headhunter sent to you.
: So it maybe just part of original question. Any idea, reference or
: discussion is welcome.
: Thanks a lot.

1 (共1页)
进入Programming版参与讨论
相关主题
one question about struct[合集] 大家看看我这个C++ STL Functor那里写错了
C++菜鸟问题请教: class versus structure.一个C++ template的问题
difference between FILE and struct FILEc++ question
The C++ questions I've been askedaccess function static variable
What does the default constructor do?问个c++的template的问题
菜鸟读C++ STL源程序的疑问定义 单链表 数组,会不会很奇怪
用STL map的时候怎么自己定义大小比较的关系Three C/C++ Programming Questions
STL 一问[转载] 问一个C++下计时的问题
相关话题的讨论汇总
话题: c++话题: stl话题: question话题: structs话题: call