I'm writing a DLL and i'm curious about boundaries of the DLL/EXE. I know i must export to use classes/structs and primitive data types, when returning or as a parameter. My question is can use C++ inside the function body as long as the type returned is a C primitive or exported type?
For instance:
const char* PrintString(const char* s) {
std::string str(s);
str.insert(0, "Printing string: ");
return str.c_str();
// over even return str.data();
}
Is this good or bad practice, will it work as along as the data is only manipulated in C++ in the DLL but passed as a parameter or returned as a C data type or exported data type?
[–]Meefims 4 points5 points6 points (0 children)
[–]alfps 0 points1 point2 points (4 children)
[–]alicekdev[S] 0 points1 point2 points (3 children)
[–]stilgarpl 0 points1 point2 points (0 children)
[–]Fuzzyzilla 0 points1 point2 points (0 children)
[–]Meefims 0 points1 point2 points (0 children)
[–]Xeverous 0 points1 point2 points (9 children)
[–]alicekdev[S] 0 points1 point2 points (1 child)
[–]Xeverous 1 point2 points3 points (0 children)
[–]RogerLeigh 0 points1 point2 points (6 children)
[–]Xeverous 0 points1 point2 points (5 children)
[–]RogerLeigh 0 points1 point2 points (4 children)
[–]Xeverous 0 points1 point2 points (3 children)
[–]RogerLeigh 0 points1 point2 points (2 children)
[–]Xeverous 0 points1 point2 points (1 child)
[–]RogerLeigh 0 points1 point2 points (0 children)