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. how to convert char array to const byte array in C

how to convert char array to const byte array in C

Scheduled Pinned Locked Moved C / C++ / MFC
data-structureshelptutorialquestion
3 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.
  • M Offline
    M Offline
    mmhu
    wrote on last edited by
    #1

    I need to use function byte*strcat(byte*, const byte*)in following strcat(byte* dest, ":"); I receive following warning: warning C4133: 'function' : incompatible types - from 'char [2]' to 'const byte *' How to resolve this problem?

    T L 2 Replies Last reply
    0
    • M mmhu

      I need to use function byte*strcat(byte*, const byte*)in following strcat(byte* dest, ":"); I receive following warning: warning C4133: 'function' : incompatible types - from 'char [2]' to 'const byte *' How to resolve this problem?

      T Offline
      T Offline
      toxcct
      wrote on last edited by
      #2

      how's defined your type byte ? have you tried to explicitely cast to (char*) and (const char*) respectedly ? moreover, what doest that mean : strcat(byte* dest, ":"); is it how you call your function ??? :wtf: oh, and at last, it is a warning, not an error, so, nothing blocking !


      Don't know where to start ?
      Refer the Forums Guidelines and ask a friend

      [VisualCalc 3.0][Flags Beginner's Guide]

      1 Reply Last reply
      0
      • M mmhu

        I need to use function byte*strcat(byte*, const byte*)in following strcat(byte* dest, ":"); I receive following warning: warning C4133: 'function' : incompatible types - from 'char [2]' to 'const byte *' How to resolve this problem?

        L Offline
        L Offline
        Like2Byte
        wrote on last edited by
        #3

        lose the 'byte *'. Calls should not contain thier datatype unless you are specifically casting it to that type and then you need to wrap the data type in parenthesis or angle brackets. such that, strcat(byte* dest, ":"); becomes, strcat((byte*) dest, ":"); /*byte* is 'casted'*/ Otherwise, just plan ol' remove the byte* from your statement, resulting in: strcat(dest, ":"); Ideally, you should ensure your datatypes are the same whereever possible.

        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