Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to add null character at end in QString.

How to add null character at end in QString.

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 4.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    Indrajeet
    wrote on last edited by
    #1

    Hi

    How to add NULL character '\0' at the end of QString.

    1 Reply Last reply
    0
    • K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      Is there a particular reason to add the null character at the end?
      You do not need in typical applications.

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0
      • L Offline
        L Offline
        lgeyer
        wrote on last edited by
        #3

        Every method, that allows for gaining access to the raw data of QString, like QString::data() or QString::unicode(), automatically terminates the string with '\0'.

        This isn't coincidentally related to "http://developer.qt.nokia.com/forums/viewthread/13631/":http://developer.qt.nokia.com/forums/viewthread/13631/, is it? If so, it would be actually useful to see how you pass the data around and how you convert them from QString to the native types.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved