Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5936607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:25:21+00:00 2026-05-22T15:25:21+00:00

The process is explained here: http://msdn.microsoft.com/en-US/library/d1ae6tz5%28v=VS.80%29.aspx What I don’t get from that article is

  • 0

The process is explained here:
http://msdn.microsoft.com/en-US/library/d1ae6tz5%28v=VS.80%29.aspx
What I don’t get from that article is that the pinned wchar_t* is passed to various C string functions that rely on the trailing null character. Is it a rule that .NET strings have a trailing null character? The System.String docs say that:

In the .NET Framework, a null character can be embedded in a string. When a string includes one or more null characters, they are included in the length of the total string.

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T15:25:22+00:00Added an answer on May 22, 2026 at 3:25 pm

    From what I understand, the internal character buffer in .NET CLR strings is null-terminated, although naturally that null character doesn’t make it into the character count, so any .NET code would ignore it. The only reason that null is there is for easy interop with Windows API or other plain C code that expects strings to be null-terminated. Instead of appending a null character any time a .NET string has to be passed to a C API (and possibly having to reallocate and copy the entire string), the null character is just there from the first place – a useful optimization in the real-world, since .NET still has to do a lot of interop behind the scenes, even if you don’t use it explicitly.

    If you do happen to have some null characters in the middle of your string, well, any C API that gets your string would probably stop there and never reach the end of the string. I guess you can even try it in C++/CLI yourself and see what happens. 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry just found this code here - http://www.yolinux.com/TUTORIALS/LinuxTutorialPosixThreads.html and the mutex was explained with
I am using the python library docx: http://github.com/mikemaccana/python-docx My goal is to open a
From this Wikipedia article: http://en.wikipedia.org/wiki/Hamiltonian_path_problem A randomized algorithm for Hamiltonian path that is fast
This is the statement from the C++03 standard, §14.7.1p5: If the overload resolution process
I am trying to create/push nuget package through visual studio build process as explained
im trying to grab search items from twitter via PHP curl, process and update
I have a super simple python script as defined here import multiprocessing from multiprocessing
I'm looking to extract pitches from a sound signal. Someone on IRC just explained
I adapted this tutorial (http://www.screaming-penguin.com/node/7749) to an Android app I've built to allow for
Could anybody explain to me the process of uploading to and downloading form and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.