Click here to Skip to main content
15,890,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,
I have a function in C#:
C#
public void fn(List<double> pDoub)
{
}


In C++, what is prototype of this function? Thannks in advance.
Posted

 
Share this answer
 
Comments
Andrewpeter 31-Mar-14 10:37am    
Thanks, my vote is 5 for you.
As requested, here's a C++ class with a function prototype.

C++
#include <vector>

class SomeClass
{

public:

void fn(std::vector<double> &list);

};
</double>


Reference:

http://www.cplusplus.com/reference/vector/vector/[^]
 
Share this answer
 
Comments
Andrewpeter 31-Mar-14 10:37am    
Thanks. My vote is 5.
Guess you are looking for a vector in c++, the list in cpp is intact a linked list.
 
Share this answer
 
Comments
Andrewpeter 31-Mar-14 11:06am    
Thanks you. I want to List to replace for Array and write dll file with C++ then call it from C#.
Guruprasad.K.Basavaraju 31-Mar-14 11:26am    
Ah I see what you are saying. I guess we cannot marshall the list type.Below from stack overflow might be a way to solve your problem.

http://stackoverflow.com/questions/5102436/how-to-marshal-collection-in-c-sharp-to-pass-to-native-c-code

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900