Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. visual c++ 2005 Express Edition vs char type

visual c++ 2005 Express Edition vs char type

Scheduled Pinned Locked Moved C / C++ / MFC
c++helpquestionvisual-studio
6 Posts 3 Posters 0 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.
  • N Offline
    N Offline
    Newbie00
    wrote on last edited by
    #1

    Hi I've written very simple code to explain my problem: char znak = 'a'; String ^ yhy = znak.ToString(); And my question is: Why yhy=="97", and not just yhy=="a" how can i write to the yhy the letter 'a' from the znak variable , i don't want its ASCII representation... i want just 'a' please help visual c++ 2005 Express Edition -- modified at 10:10 Wednesday 7th February, 2007

    M 1 Reply Last reply
    0
    • N Newbie00

      Hi I've written very simple code to explain my problem: char znak = 'a'; String ^ yhy = znak.ToString(); And my question is: Why yhy=="97", and not just yhy=="a" how can i write to the yhy the letter 'a' from the znak variable , i don't want its ASCII representation... i want just 'a' please help visual c++ 2005 Express Edition -- modified at 10:10 Wednesday 7th February, 2007

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      This would be better asked here on the C++/CLI board[^] A char is a byte. You've requested the string representation of a byte by using ToString(). Can't you use something like: String ^ yhy = "a"; or String ^ yhy = gcnew String("a");

      N 1 Reply Last reply
      0
      • M Mark Salsbery

        This would be better asked here on the C++/CLI board[^] A char is a byte. You've requested the string representation of a byte by using ToString(). Can't you use something like: String ^ yhy = "a"; or String ^ yhy = gcnew String("a");

        N Offline
        N Offline
        Newbie00
        wrote on last edited by
        #3

        I can't use: String ^yhy="a"; because important data is in the variable znak But I used gcnew: char znak='a'; Str ^yhy; Str = gcnew String(&znak); Thx Mark for your reply, I didn't know how to convert variables in vc++ gcnew String(const wchar_t *value) <--:O that's good haha:] I've just read about it in vc++ help

        H 1 Reply Last reply
        0
        • N Newbie00

          I can't use: String ^yhy="a"; because important data is in the variable znak But I used gcnew: char znak='a'; Str ^yhy; Str = gcnew String(&znak); Thx Mark for your reply, I didn't know how to convert variables in vc++ gcnew String(const wchar_t *value) <--:O that's good haha:] I've just read about it in vc++ help

          H Offline
          H Offline
          Hamid Taebi
          wrote on last edited by
          #4

          If you post your answer to correct forum you can get your answer early ;)


          WhiteSky


          N 1 Reply Last reply
          0
          • H Hamid Taebi

            If you post your answer to correct forum you can get your answer early ;)


            WhiteSky


            N Offline
            N Offline
            Newbie00
            wrote on last edited by
            #5

            I know i know i'm sorry i used wrong place to talk about my problem. Fortunately i've got the solution, so thanks again.

            H 1 Reply Last reply
            0
            • N Newbie00

              I know i know i'm sorry i used wrong place to talk about my problem. Fortunately i've got the solution, so thanks again.

              H Offline
              H Offline
              Hamid Taebi
              wrote on last edited by
              #6

              No problem;)


              WhiteSky


              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups