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#
  4. convert piece of code from C++ to C#

convert piece of code from C++ to C#

Scheduled Pinned Locked Moved C#
csharpc++question
2 Posts 2 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
    MrKBA
    wrote on last edited by
    #1

    I have a piece of code in c++ and I want to know how it can be in C# : int m_it[MAX_BC]; int m_iKe[MAX_ROUNDS][MAX_BC]; char const* a_pchIn; int* pi = m_it; for(i=0; i<8; i++) { *pi = ((unsigned char)*(a_pchIn++) << 24); *pi |= ((unsigned char)*(a_pchIn++) << 16); *pi |= ((unsigned char)*(a_pchIn++) << 8); (*(pi++) |= (unsigned char)*(a_pchIn++)) ^= m_iKe[0][i]; } In C# ? Thank you

    R 1 Reply Last reply
    0
    • M MrKBA

      I have a piece of code in c++ and I want to know how it can be in C# : int m_it[MAX_BC]; int m_iKe[MAX_ROUNDS][MAX_BC]; char const* a_pchIn; int* pi = m_it; for(i=0; i<8; i++) { *pi = ((unsigned char)*(a_pchIn++) << 24); *pi |= ((unsigned char)*(a_pchIn++) << 16); *pi |= ((unsigned char)*(a_pchIn++) << 8); (*(pi++) |= (unsigned char)*(a_pchIn++)) ^= m_iKe[0][i]; } In C# ? Thank you

      R Offline
      R Offline
      RedDk
      wrote on last edited by
      #2

      This answer might erk a few programmers here in Discussions, but I can recall having a moderate amount of success taking C++ code verbatim and pasting it as C# code in the C# code behind module I was working on, attempting a compile, THEN ACTUALLY working from the compiler error list to clear the syntax breaks while F2-ing the HELP tome. 'Might try this if you find no other solution ...

      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