Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #26253
| Path | csiph.com!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Jim Janney <jjanney@shell.xmission.com> |
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: End of String Problem: Sending C++ string to java code |
| Date | Wed, 09 Oct 2013 10:50:16 -0600 |
| Organization | land of the onion and the eel |
| Lines | 19 |
| Message-ID | <ydnmwmijsmv.fsf@shell.xmission.com> (permalink) |
| References | <177b1b66-ea89-4995-ab6c-9187bb754895@googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Injection-Info | mx05.eternal-september.org; posting-host="c75a2e3068ccf6c98395286f3e40b97d"; logging-data="16240"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/HFzPvlWl+YopbfaGkiNWv" |
| User-Agent | Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) |
| Cancel-Lock | sha1:XIav6ggoTN2UaM/TAJfaNDZVqXs= sha1:nt9KSLRtIZgzzATiCI982nrrr9s= |
| Xref | csiph.com comp.lang.java.programmer:26253 |
Show key headers only | View raw
clusardi2k@aol.com writes:
> Question: How should I send a string from C++ to java.
>
> When I send a string (std::string) from the C++ code to the java code (String), I have to count (on the java side) the number of characters that I expect.
>
> If I don't take a specific number of characters I get more characters than I want on the java side. The extra characters are garbage.
>
> I tried appending the standard end of string ("\0") in C++ code and sending the string to java code, but the problem was not resolved.
>
> Any ideas,
> Thanks,
My C++ is very rusty at the moment, but I'm pretty sure that instances
of std::string can contain nul characters internally. Use the size or
length methods to get the number of characters.
--
Jim Janney
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
End of String Problem: Sending C++ string to java code clusardi2k@aol.com - 2013-10-08 09:56 -0700
Re: End of String Problem: Sending C++ string to java code Arivald <NOSPAMarivald@interia.pl> - 2013-10-08 20:05 +0200
Re: End of String Problem: Sending C++ string to java code Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2013-10-08 11:13 -0700
Re: End of String Problem: Sending C++ string to java code Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-10-08 20:30 -0400
Re: End of String Problem: Sending C++ string to java code Mark <i@dontgetlotsofspamanymore.invalid> - 2013-10-09 15:29 +0100
Re: End of String Problem: Sending C++ string to java code "Chris Uppal" <chris.uppal@metagnostic.REMOVE-THIS.org> - 2013-10-09 15:35 +0100
Re: End of String Problem: Sending C++ string to java code Jim Janney <jjanney@shell.xmission.com> - 2013-10-09 10:50 -0600
Re: End of String Problem: Sending C++ string to java code Jim Janney <jjanney@shell.xmission.com> - 2013-10-09 11:03 -0600
csiph-web