Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8692129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T00:15:32+00:00 2026-06-13T00:15:32+00:00

I am a C# guy who is desperately trying to learn C++ and port

  • 0

I am a C# guy who is desperately trying to learn C++ and port some old code over. Been doing OK so far but the following method has me stumped. If anyone could give me some pointers (sorry for pun) I would be grateful.

C# method:

public static string crappyEncryption(String userKey)    
{    
    StringBuilder eStr = new StringBuilder();    
    String key1 = "somehorriblelongstring";    
    String key2 = "someotherhorriblelongstring";    
    for (int i = 0; i < userKey.Length; i++)   
    {    
        eStr.Append(key2[key1.IndexOf(userKey[i])]);    
    }    
    return encodeTo64(eStr.ToString());    
} 

encodeTo64 is a local method which I have solved in C++. This weird method (if you were wondering) was a small encryption method I came up with that we could use mobile cross platform for non-essential string encryption.

Thanks very much

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T00:15:33+00:00Added an answer on June 13, 2026 at 12:15 am

    Not gonna give you the whole code, but some pointers:

    • a StringBuilder can be substituted by a std::stringstream.
    • a String is a std::string
    • it has the method length(), find() and operator[].
    • std::stringstream has operator << for Append.
    • ToString is std::stringstream::str().
    • you’ll want to pass userKey by reference.

    All concepts you don’t understand can easily be found with a google search.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am an old Unix guy who is converting a makefile based project over
I'm trying to get my spring application working, following a guy who posted an
Original code from JamieMThomas , a (really good guy who is trying to combine
I'm currently doing this query to find the guy who makes the most calls:
So there is the guy on the internet who wrote a ton of code
I have been hearing about F# and Microsoft now have a guy who is
I been following a tutorial word for word but i get an error which
I had to take over a c# project. The guy who developed the software
I'm a .Net guy who has just been handed a LAMP-based project (where P=PHP),
Always code as if the guy who ends up maintaining your code will be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.