newbie question: exporting a string from a function using vc++4 
Author Message
 newbie question: exporting a string from a function using vc++4

trying to return a string from a function using vc++4,
#include <string.h>

using namespace std;

string myfunc(char *word)
{
......
......
return(out)

Quote:
}

doesnt seem to work, appereantly Im not understanding how to allow a
function to return a string using c++


Thu, 30 Oct 2003 23:35:34 GMT  
 newbie question: exporting a string from a function using vc++4

Quote:
> trying to return a string from a function using vc++4,
> #include <string.h>

> using namespace std;

> string myfunc(char *word)
> {
> ......
> ......
> return(out)
> }
> doesnt seem to work, appereantly Im not understanding how to allow a
> function to return a string using c++

"Doesn't seem to work" doesn't give us much to go on, you should always post
the error messages you are getting, but a couple of points:

- does VC++ 4.x even support the standard C++ library? I don't think so, but
I could be wrong.
- the header <string.h> is the header for old-style C functions such as
strvmp etc. not the standard string class - that is in <string>

NeilB



Thu, 30 Oct 2003 22:44:29 GMT  
 newbie question: exporting a string from a function using vc++4
VC++ 4 doesn't support namespaces or STL.  It's time to upgrade.


Fri, 31 Oct 2003 04:45:44 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Newbie question: using malloc() to create a string?

2. how to export the API function in VC?

3. VC definition files: exporting functions

4. How to export function on VC like def file

5. Help: Need to export VC 5.0 function in DLL to be called from VB 5.0

6. Listing of exported functions in a VC++'s .lib file

7. Using VC to Export a Registry Branch?

8. Newbie question: Strings and string manipulation.

9. problem using std::string in exported class to be puit in a DLL

10. Exporting string from dll using non DLL version of CRT

11. using std::string and vector in DLL exported class

12. using std::string in my dll-exported class

 

 
Powered by phpBB® Forum Software