Convert TCHAR [] to const ***

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tezu
    New Member
    • Dec 2008
    • 39

    #1

    Convert TCHAR [] to const ***

    HI all,

    How 2 convert a TCHAR [] to a char ***

    Thanks in advance :)
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    (char ***)your_tchar_ arr;

    Comment

    • weaknessforcats
      Recognized Expert Expert
      • Mar 2007
      • 9214

      #3
      A char*** is not a pointer to an array.

      Please read: http://bytes.com/topic/c/insights/77...rrays-revealed

      A TCHAR points to either a CHAR or a WCHAR based on the character set of your project. That cast will force a char pointer to point at a WCHAR data type and screw up your code.

      Do not cast.

      Stick with the TCHAR rules. That means no char, CHAR, PCHAR, WCHAR, LPSTR, LPWSTR, etc in your code. Only TCHAR and the TCHAR mappings and the TCHAR function equivalents.

      Comment

      • tezu
        New Member
        • Dec 2008
        • 39

        #4
        Thx for teh reply , i think char*** is a two dimensional array ......

        My requirement is tht i have a function which returns me TCHAR [] now i have to fill these values into the char*** array ..... how can i do it ???

        Comment

        • weaknessforcats
          Recognized Expert Expert
          • Mar 2007
          • 9214

          #5
          First, you should be clear on the difference between a pointer and an array.

          Second, read the article that I indicated. Your last post tells me you did not read this or you wouldn't ask this question.

          Comment

          Working...